0
0
Fork 0

Allow keeping only 1 boosts/favs on auto deleting posts (#16653)

* Allow keeping 1 boosts/favs on auto deleting posts

* Fix tests
This commit is contained in:
Jeong Arm 2021-10-15 04:11:14 +09:00 committed by GitHub
parent 3f5f4273b3
commit f4081d1564
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View file

@ -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