From 8d6f033326e3db91d879dd950f589b10313394b7 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 28 Jul 2025 08:55:05 -0400 Subject: [PATCH] Fix `Style/GuardClause` in move worker (#35520) --- app/workers/move_worker.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/workers/move_worker.rb b/app/workers/move_worker.rb index 667efd691..58d20ba94 100644 --- a/app/workers/move_worker.rb +++ b/app/workers/move_worker.rb @@ -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)