0
0
Fork 0

Improve notification model

This commit is contained in:
Eugen Rochko 2016-12-03 20:04:19 +01:00
parent 5abf64d647
commit b14b5e3b44
5 changed files with 27 additions and 9 deletions

View file

@ -94,11 +94,11 @@ class Status < ApplicationRecord
class << self
def as_home_timeline(account)
where(account: [account] + account.following).with_includes
where(account: [account] + account.following)
end
def as_mentions_timeline(account)
where(id: Mention.where(account: account).pluck(:status_id)).with_includes
where(id: Mention.where(account: account).select(:status_id))
end
def as_public_timeline(account = nil)