]> cat aescling's git repositories - mastodon.git/commitdiff
Fix index not being used in Status.reblogs_map (#11982)
authorEugen Rochko <eugen@zeonfederated.com>
Fri, 27 Sep 2019 23:33:02 +0000 (01:33 +0200)
committerGitHub <noreply@github.com>
Fri, 27 Sep 2019 23:33:02 +0000 (01:33 +0200)
Regression from #11623

app/models/status.rb

index 471bb03b47623c97147eba4d1a87b6d8ecb1448c..6afaa14d1435cc4a4c6586cae72c2fb392bdec30 100644 (file)
@@ -305,7 +305,7 @@ class Status < ApplicationRecord
     end
 
     def reblogs_map(status_ids, account_id)
-      select('reblog_of_id').where(reblog_of_id: status_ids).where(account_id: account_id).reorder(nil).each_with_object({}) { |s, h| h[s.reblog_of_id] = true }
+      select('reblog_of_id').where(reblog_of_id: status_ids).where(account_id: account_id).unscoped.each_with_object({}) { |s, h| h[s.reblog_of_id] = true }
     end
 
     def mutes_map(conversation_ids, account_id)