Fix Style/GuardClause in move worker (#35520)

This commit is contained in:
Matt Jankowski 2025-07-28 08:55:05 -04:00 committed by GitHub
parent b5cebf45ea
commit 8d6f033326
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,12 +123,12 @@ class MoveWorker
end
def add_account_note_if_needed!(account, id)
unless AccountNote.exists?(account: account, target_account: @target_account)
text = I18n.with_locale(account.user_locale.presence || I18n.default_locale) do
I18n.t(id, acct: @source_account.acct)
end
AccountNote.create!(account: account, target_account: @target_account, comment: text)
return if AccountNote.exists?(account: account, target_account: @target_account)
text = I18n.with_locale(account.user_locale.presence || I18n.default_locale) do
I18n.t(id, acct: @source_account.acct)
end
AccountNote.create!(account: account, target_account: @target_account, comment: text)
end
def skip_mute_move?(mute)