mirror of
https://github.com/discourse/discourse.git
synced 2025-03-15 08:25:28 +08:00
Revert "PERF: Query for email was not using index."
This reverts commit 65eb046e69885bc0f464862d173b142e9c89396a.
This commit is contained in:
parent
65eb046e69
commit
c85e1fdb50
@ -134,9 +134,7 @@ class User < ActiveRecord::Base
|
||||
# set to true to optimize creation and save for imports
|
||||
attr_accessor :import_mode
|
||||
|
||||
scope :with_email, ->(email) do
|
||||
joins(:user_emails).where("lower(user_emails.email)::text = ?", email)
|
||||
end
|
||||
scope :with_email, ->(email) { joins(:user_emails).where(user_emails: { email: email }) }
|
||||
|
||||
scope :human_users, -> { where('users.id > 0') }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user