From f4081d15647c5fb4e6b4a1020518d4cf44d7a7c0 Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Fri, 15 Oct 2021 04:11:14 +0900 Subject: Allow keeping only 1 boosts/favs on auto deleting posts (#16653) * Allow keeping 1 boosts/favs on auto deleting posts * Fix tests --- app/models/account_statuses_cleanup_policy.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/models/account_statuses_cleanup_policy.rb b/app/models/account_statuses_cleanup_policy.rb index 705ccff54..0a9551ec2 100644 --- a/app/models/account_statuses_cleanup_policy.rb +++ b/app/models/account_statuses_cleanup_policy.rb @@ -164,8 +164,8 @@ class AccountStatusesCleanupPolicy < ApplicationRecord def without_popular_scope scope = Status.left_joins(:status_stat) - scope = scope.where('COALESCE(status_stats.reblogs_count, 0) <= ?', min_reblogs) unless min_reblogs.nil? - scope = scope.where('COALESCE(status_stats.favourites_count, 0) <= ?', min_favs) unless min_favs.nil? + scope = scope.where('COALESCE(status_stats.reblogs_count, 0) < ?', min_reblogs) unless min_reblogs.nil? + scope = scope.where('COALESCE(status_stats.favourites_count, 0) < ?', min_favs) unless min_favs.nil? scope end end -- cgit