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:
parent
3f5f4273b3
commit
f4081d1564
3 changed files with 10 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue