From 806199ed4ae23fd165397b41405523e672c7e090 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 21 Dec 2019 15:24:34 -0600 Subject: add virtual scopes for `#``self.boosts` (your boosts) & `#``self.home.boosts` (boosts on your home timeline) --- app/models/status.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/models/status.rb') 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 -- cgit