]> source.dussan.org Git - redmine.git/commitdiff
code layout clean up lib/redmine/field_format.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 25 Nov 2019 16:47:52 +0000 (16:47 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 25 Nov 2019 16:47:52 +0000 (16:47 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19299 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/field_format.rb

index 2fcd7b79b4f8723ddbe200c9991daf152e5873fd..d063d1ccf6005367e9841231eb5c13d677765865 100644 (file)
@@ -271,8 +271,16 @@ 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