diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-04 19:12:59 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-04 19:12:59 +0100 |
commit | 62292797eccc5bcf47abae9f4daaa2c186660644 (patch) | |
tree | fb324996024317abc9605015845f7467508d5d73 /app/models/status.rb | |
parent | 6471a548feadf34d65fb96660f958bf808331c8f (diff) |
Adding hashtag model
Diffstat (limited to 'app/models/status.rb')
-rw-r--r-- | app/models/status.rb | 8 |
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 |