summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-11-25 16:47:52 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-11-25 16:47:52 +0000
commit18e8a45752073f90c808621ac09db47f6359cfd0 (patch)
treec9fe44aa3a7df8a63bf25a64d3a5981add56ab4a /lib
parent6f30f70c43c22129dfd07230de94dd544f4b1a1c (diff)
downloadredmine-18e8a45752073f90c808621ac09db47f6359cfd0.tar.gz
redmine-18e8a45752073f90c808621ac09db47f6359cfd0.zip
code layout clean up lib/redmine/field_format.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@19299 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/field_format.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb
index 2fcd7b79b..d063d1ccf 100644
--- a/lib/redmine/field_format.rb
+++ b/lib/redmine/field_format.rb
@@ -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