about summary refs log tree commit diff
path: root/app/models/status.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/status.rb')
-rw-r--r--app/models/status.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 1cd56c97b..c26e73d71 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -77,6 +77,14 @@ class Status < ApplicationRecord
     ids.map { |id| statuses[id].first }
   end
 
+  def reblogged_by(limit)
+    Account.where(id: reblogs.limit(limit).pluck(:account_id)).with_counters
+  end
+
+  def favourited_by(limit)
+    Account.where(id: favourites.limit(limit).pluck(:account_id)).with_counters
+  end
+
   def self.as_home_timeline(account)
     where(account: [account] + account.following).with_includes.with_counters
   end