]> cat aescling's git repositories - mastodon.git/commitdiff
Fix warning about using SQL in order for Account#partitioned (#7159)
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 17 Apr 2018 11:50:48 +0000 (13:50 +0200)
committerGitHub <noreply@github.com>
Tue, 17 Apr 2018 11:50:48 +0000 (13:50 +0200)
app/models/account.rb

index 05e817f63dd25f93f91ad0133beae39c3a7b9d11..a3436b47ca60ae27658a5c2debd79eb1560a1898 100644 (file)
@@ -114,7 +114,7 @@ class Account < ApplicationRecord
   scope :without_followers, -> { where(followers_count: 0) }
   scope :with_followers, -> { where('followers_count > 0') }
   scope :expiring, ->(time) { remote.where.not(subscription_expires_at: nil).where('subscription_expires_at < ?', time) }
-  scope :partitioned, -> { order('row_number() over (partition by domain)') }
+  scope :partitioned, -> { order(Arel.sql('row_number() over (partition by domain)')) }
   scope :silenced, -> { where(silenced: true) }
   scope :suspended, -> { where(suspended: true) }
   scope :recent, -> { reorder(id: :desc) }