Fix Performance/MapCompact cop (#24797)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
0664704cd9
commit
9f5deb310b
16 changed files with 25 additions and 44 deletions
|
@ -117,12 +117,12 @@ class AccountStatusesCleanupPolicy < ApplicationRecord
|
|||
private
|
||||
|
||||
def update_last_inspected
|
||||
if EXCEPTION_BOOLS.map { |name| attribute_change_to_be_saved(name) }.compact.include?([true, false])
|
||||
if EXCEPTION_BOOLS.filter_map { |name| attribute_change_to_be_saved(name) }.include?([true, false])
|
||||
# Policy has been widened in such a way that any previously-inspected status
|
||||
# may need to be deleted, so we'll have to start again.
|
||||
redis.del("account_cleanup:#{account_id}")
|
||||
end
|
||||
redis.del("account_cleanup:#{account_id}") if EXCEPTION_THRESHOLDS.map { |name| attribute_change_to_be_saved(name) }.compact.any? { |old, new| old.present? && (new.nil? || new > old) }
|
||||
redis.del("account_cleanup:#{account_id}") if EXCEPTION_THRESHOLDS.filter_map { |name| attribute_change_to_be_saved(name) }.any? { |old, new| old.present? && (new.nil? || new > old) }
|
||||
end
|
||||
|
||||
def validate_local_account
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue