mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:29:30 +08:00
PERF: Scanning the id
for this is signficantly slower in production
This commit is contained in:
parent
fd7bb8e656
commit
5d1d7e0e7d
|
@ -449,7 +449,7 @@ class User < ActiveRecord::Base
|
|||
|
||||
def publish_notifications_state
|
||||
# publish last notification json with the message so we can apply an update
|
||||
notification = notifications.visible.order('notifications.id desc').first
|
||||
notification = notifications.visible.order('notifications.created_at desc').first
|
||||
json = NotificationSerializer.new(notification).as_json if notification
|
||||
|
||||
sql = (<<~SQL).freeze
|
||||
|
|
Loading…
Reference in New Issue
Block a user