Browse Source

Merge pull request #435 from krainboltgreene/patch-1

Using "rails style" order arguments
closed-social-glitch-2
Eugen 7 years ago
committed by GitHub
parent
commit
4447c4c7c8
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      app/models/account.rb

+ 2
- 2
app/models/account.rb View File

@ -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 :silenced, -> { where(silenced: true) }
scope :suspended, -> { where(suspended: true) }
scope :recent, -> { reorder('id desc') }
scope :alphabetic, -> { order('domain ASC, username ASC') }
scope :recent, -> { reorder(id: :desc) }
scope :alphabetic, -> { order(domain: :asc, username: :asc) }
def follow!(other_account)
active_relationships.where(target_account: other_account).first_or_create!(target_account: other_account)

Loading…
Cancel
Save