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

This commit is contained in:
Eugen Rochko 2018-04-17 13:50:48 +02:00 committed by GitHub
parent 727917e91e
commit bb58fc003b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ class Account < ApplicationRecord
scope :without_followers, -> { where(followers_count: 0) } scope :without_followers, -> { where(followers_count: 0) }
scope :with_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 :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 :silenced, -> { where(silenced: true) }
scope :suspended, -> { where(suspended: true) } scope :suspended, -> { where(suspended: true) }
scope :recent, -> { reorder(id: :desc) } scope :recent, -> { reorder(id: :desc) }