0
0
Fork 0

Introduce recent to Follow (#3247)

Introduce recent to Follow, as Account and other models have.
This change also adds specs for the scope and the dependents.
This commit is contained in:
Akihiko Odaki 2017-05-23 20:12:19 +09:00 committed by Eugen Rochko
parent 860ffc0560
commit bf575a1f5e
6 changed files with 41 additions and 6 deletions

View file

@ -23,4 +23,6 @@ class Follow < ApplicationRecord
has_one :notification, as: :activity, dependent: :destroy
validates :account_id, uniqueness: { scope: :target_account_id }
scope :recent, -> { reorder(id: :desc) }
end