mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 11:43:56 +08:00
REFACTOR: Don't load entire AR object just to get a column.
This commit is contained in:
parent
7da22e395b
commit
be71f9ff82
|
@ -65,8 +65,9 @@ class EmailLog < ActiveRecord::Base
|
||||||
def self.last_sent_email_address
|
def self.last_sent_email_address
|
||||||
self.where(email_type: "signup")
|
self.where(email_type: "signup")
|
||||||
.order(created_at: :desc)
|
.order(created_at: :desc)
|
||||||
|
.limit(1)
|
||||||
|
.pluck(:to_address)
|
||||||
.first
|
.first
|
||||||
.try(:to_address)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def bounce_key
|
def bounce_key
|
||||||
|
|
Loading…
Reference in New Issue
Block a user