Fix warning about using SQL in order for Account#partitioned (#7159)

th-downstream
Eugen Rochko 7 years ago committed by GitHub
parent e6138441b7
commit 4f460eba18

@ -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) }

Loading…
Cancel
Save