about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-04-17 13:50:48 +0200
committerGitHub <noreply@github.com>2018-04-17 13:50:48 +0200
commitbb58fc003b5d9ac521a89e7f37c0b7fc1d45a4c9 (patch)
tree45972e18f403bdfcf930d3378470e6fade89cda0
parent727917e91eea3582586d3ce710826ef33ae26ffb (diff)
Fix warning about using SQL in order for Account#partitioned (#7159)
-rw-r--r--app/models/account.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 05e817f63..a3436b47c 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -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) }