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
This commit is contained in:
Toshi MARUYAMA
2019-11-24 13:19:50 +00:00
parent a85b776324
commit a7824755ee
2 changed files with 2 additions and 3 deletions

View File

@@ -384,7 +384,6 @@ Lint/Loop:
Lint/ParenthesesAsGroupedExpression: Lint/ParenthesesAsGroupedExpression:
Exclude: Exclude:
- 'lib/redmine/field_format.rb'
- 'test/functional/account_controller_test.rb' - 'test/functional/account_controller_test.rb'
- 'test/functional/email_addresses_controller_test.rb' - 'test/functional/email_addresses_controller_test.rb'
- 'test/functional/my_controller_test.rb' - 'test/functional/my_controller_test.rb'

View File

@@ -271,8 +271,8 @@ module Redmine
url = custom_field.url_pattern.to_s.dup url = custom_field.url_pattern.to_s.dup
url.gsub!('%value%') {URI.encode value.to_s} url.gsub!('%value%') {URI.encode value.to_s}
url.gsub!('%id%') {URI.encode customized.id.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_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_identifier%') {URI.encode((customized.respond_to?(:project) ? customized.project.try(:identifier) : nil).to_s)}
if custom_field.regexp.present? if custom_field.regexp.present?
url.gsub!(%r{%m(\d+)%}) do url.gsub!(%r{%m(\d+)%}) do
m = $1.to_i m = $1.to_i