summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-01-12 04:04:22 +0000
committerGo MAEDA <maeda@farend.jp>2023-01-12 04:04:22 +0000
commit5113040a05cefafd0f80ee380e6b3c36809f97c6 (patch)
tree93a368fbf6b1fa105615c0f6660ba0cab057e801 /app/helpers
parent2cf2bfdbed06cb17c704a79c33add9175eff8320 (diff)
downloadredmine-5113040a05cefafd0f80ee380e6b3c36809f97c6.tar.gz
redmine-5113040a05cefafd0f80ee380e6b3c36809f97c6.zip
Unreachable branch in ApplicationHelper#format_object due to the use of the deprecated Fixnum class (#38145).
Patch by Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@22041 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 316700270..fac31d569 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -255,31 +255,31 @@ module ApplicationHelper
if block
object = yield object
end
- case object.class.name
- when 'Array'
+ case object
+ when Array
formatted_objects = object.map {|o| format_object(o, html)}
html ? safe_join(formatted_objects, ', ') : formatted_objects.join(', ')
- when 'Time'
+ when Time
format_time(object)
- when 'Date'
+ when Date
format_date(object)
- when 'Fixnum'
+ when Integer
object.to_s
- when 'Float'
+ when Float
sprintf "%.2f", object
- when 'User', 'Group'
+ when User, Group
html ? link_to_principal(object) : object.to_s
- when 'Project'
+ when Project
html ? link_to_project(object) : object.to_s
- when 'Version'
+ when Version
html ? link_to_version(object) : object.to_s
- when 'TrueClass'
+ when TrueClass
l(:general_text_Yes)
- when 'FalseClass'
+ when FalseClass
l(:general_text_No)
- when 'Issue'
+ when Issue
object.visible? && html ? link_to_issue(object) : "##{object.id}"
- when 'Attachment'
+ when Attachment
if html
content_tag(
:span,
@@ -294,7 +294,7 @@ module ApplicationHelper
else
object.filename
end
- when 'CustomValue', 'CustomFieldValue'
+ when CustomValue, CustomFieldValue
return "" unless object.customized&.visible?
if object.custom_field