From bf575a1f5e45515733c8c518182bbb0a3c439920 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 23 May 2017 20:12:19 +0900 Subject: 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. --- app/models/follow.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/models') diff --git a/app/models/follow.rb b/app/models/follow.rb index 863710f5d..62f6fb670 100644 --- a/app/models/follow.rb +++ b/app/models/follow.rb @@ -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 -- cgit