0
0
Fork 0

Autofix Rubocop Style/IfUnlessModifier (#23697)

This commit is contained in:
Nick Schonning 2023-02-18 06:37:47 -05:00 committed by GitHub
parent 9ab2a775c9
commit e2a3ebb271
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 55 additions and 271 deletions

View file

@ -122,9 +122,7 @@ class AccountStatusesCleanupPolicy < ApplicationRecord
# may need to be deleted, so we'll have to start again.
redis.del("account_cleanup:#{account.id}")
end
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}")
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) }
end
def validate_local_account
@ -141,9 +139,7 @@ class AccountStatusesCleanupPolicy < ApplicationRecord
# has switched to snowflake IDs significantly over 2 years ago anyway.
snowflake_id = Mastodon::Snowflake.id_at(min_status_age.seconds.ago, with_random: false)
if max_id.nil? || snowflake_id < max_id
max_id = snowflake_id
end
max_id = snowflake_id if max_id.nil? || snowflake_id < max_id
Status.where(Status.arel_table[:id].lteq(max_id))
end