diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-12-21 15:24:34 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-12-21 15:25:32 -0600 |
commit | 806199ed4ae23fd165397b41405523e672c7e090 (patch) | |
tree | 3b224576fcea701a35b18449a5e2cedd5f0ca01d /app/models | |
parent | 5f92c6429fac98e5c9e3b02d158b6d4eab89945d (diff) |
add virtual scopes for `#``self.boosts` (your boosts) & `#``self.home.boosts` (boosts on your home timeline)
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/status.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/status.rb b/app/models/status.rb index a47f846a5..f4c90fea2 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -391,9 +391,10 @@ class Status < ApplicationRecord where(language: nil).or where(language: account.chosen_languages) end - def as_home_timeline(account) + def as_home_timeline(account, reblogs_only: false) query = where(account: [account] + account.following, visibility: [:public, :unlisted, :local, :private]) - query = query.without_reblogs if account.present? && account&.user&.hide_boosts + query = query.without_reblogs if !reblogs_only && account.present? && account&.user&.hide_boosts + query = query.reblogs if reblogs_only query end |