From 72df048f8419fc339aad9bbb5503a3108e0534d3 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Fri, 22 May 2020 00:40:31 -0400 Subject: [PATCH] Updated home_feed.rb as_home_timeline to be date restricted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Updated: - home_feed.rb as_home_timeline to be date restricted to only 45 days --- app/models/home_feed.rb | 2 +- app/models/status.rb | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/models/home_feed.rb b/app/models/home_feed.rb index bf89551d..ba756498 100644 --- a/app/models/home_feed.rb +++ b/app/models/home_feed.rb @@ -18,7 +18,7 @@ class HomeFeed < Feed private def from_database(limit, max_id, since_id, min_id) - Status.as_home_timeline(@account, max_id) + Status.as_home_timeline(@account) .paginate_by_id(limit, max_id: max_id, since_id: since_id, min_id: min_id) .reject { |status| FeedManager.instance.filter?(:home, status, @account.id) } end diff --git a/app/models/status.rb b/app/models/status.rb index 110333de..3a43f27e 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -290,14 +290,10 @@ class Status < ApplicationRecord where(language: nil).or where(language: account.chosen_languages) end - def as_home_timeline(account, max_id) + def as_home_timeline(account) query = where(account: [account] + account.following).without_replies query.where(visibility: [:public, :unlisted, :private]) - if max_id.nil? - query.where('updated_at > ?', 60.days.ago) - else - query - end + query.where('updated_at > ?', 45.days.ago) end def as_group_timeline(group)