From: Toshi MARUYAMA Date: Sun, 24 Nov 2019 13:19:50 +0000 (+0000) Subject: cleanup: rubocop: fix Lint/ParenthesesAsGroupedExpression in lib/redmine/field_format.rb X-Git-Tag: 4.2.0~1379 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a7824755eeac926b2eabd16b2e002fde426f4141;p=redmine.git cleanup: rubocop: fix Lint/ParenthesesAsGroupedExpression in lib/redmine/field_format.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19261 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 2439f575e..ecec91511 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -384,7 +384,6 @@ Lint/Loop: Lint/ParenthesesAsGroupedExpression: Exclude: - - 'lib/redmine/field_format.rb' - 'test/functional/account_controller_test.rb' - 'test/functional/email_addresses_controller_test.rb' - 'test/functional/my_controller_test.rb' diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb index bc2def962..2fcd7b79b 100644 --- a/lib/redmine/field_format.rb +++ b/lib/redmine/field_format.rb @@ -271,8 +271,8 @@ module Redmine url = custom_field.url_pattern.to_s.dup url.gsub!('%value%') {URI.encode value.to_s} url.gsub!('%id%') {URI.encode customized.id.to_s} - url.gsub!('%project_id%') {URI.encode (customized.respond_to?(:project) ? customized.project.try(:id) : nil).to_s} - url.gsub!('%project_identifier%') {URI.encode (customized.respond_to?(:project) ? customized.project.try(:identifier) : nil).to_s} + url.gsub!('%project_id%') {URI.encode((customized.respond_to?(:project) ? customized.project.try(:id) : nil).to_s)} + url.gsub!('%project_identifier%') {URI.encode((customized.respond_to?(:project) ? customized.project.try(:identifier) : nil).to_s)} if custom_field.regexp.present? url.gsub!(%r{%m(\d+)%}) do m = $1.to_i