mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Using "rails style" order arguments
This commit is contained in:
parent
7a0a13ab53
commit
e5d9009d71
@ -62,8 +62,8 @@ class Account < ApplicationRecord
|
|||||||
scope :expiring, ->(time) { where(subscription_expires_at: nil).or(where('subscription_expires_at < ?', time)).remote.with_followers }
|
scope :expiring, ->(time) { where(subscription_expires_at: nil).or(where('subscription_expires_at < ?', time)).remote.with_followers }
|
||||||
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) }
|
||||||
scope :alphabetic, -> { order('domain ASC, username ASC') }
|
scope :alphabetic, -> { order(domain: :asc, username: :asc) }
|
||||||
|
|
||||||
def follow!(other_account)
|
def follow!(other_account)
|
||||||
active_relationships.where(target_account: other_account).first_or_create!(target_account: other_account)
|
active_relationships.where(target_account: other_account).first_or_create!(target_account: other_account)
|
||||||
|
Loading…
Reference in New Issue
Block a user