From d4a428f11edad6b2f3b9f394151024f918d9e48c Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 17 Oct 2019 15:28:46 +0000 Subject: [PATCH] code cleanup: rubocop: fix Layout/ElseAlignment in app/helpers/attachments_helper.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18713 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .rubocop_todo.yml | 5 ----- app/helpers/attachments_helper.rb | 13 ++++++------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index dcd4a3335..7d4888452 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -102,11 +102,6 @@ Layout/CommentIndentation: Layout/DotPosition: Enabled: false -# Cop supports --auto-correct. -Layout/ElseAlignment: - Exclude: - - 'app/helpers/attachments_helper.rb' - # Cop supports --auto-correct. Layout/EmptyLineAfterGuardClause: Enabled: false diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb index 476b93ef3..d03997c4b 100644 --- a/app/helpers/attachments_helper.rb +++ b/app/helpers/attachments_helper.rb @@ -33,13 +33,12 @@ module AttachmentsHelper # :thumbails -- display thumbnails if enabled in settings def link_to_attachments(container, options = {}) options.assert_valid_keys(:author, :thumbnails) - - attachments = if container.attachments.loaded? - container.attachments - else - container.attachments.preload(:author).to_a - end - + attachments = + if container.attachments.loaded? + container.attachments + else + container.attachments.preload(:author).to_a + end if attachments.any? options = { :editable => container.attachments_editable?, -- 2.39.5