Actions
Defect #38145
closedUnreachable branch in ApplicationHelper#format_object due to the use of the deprecated Fixnum class
Defect #38145:
Unreachable branch in ApplicationHelper#format_object due to the use of the deprecated Fixnum class
Resolution:
Fixed
Affected version:
Description
There is an unreachable branch in ApplicationHelper#format_object. This is because a deprecated class name `Fixnum` is given to the `when` keyword.
Reference:
Unify Fixnum and Bignum into Integer
https://bugs.ruby-lang.org/issues/12005
While the branch is unreachable, fortunately, the result of the code below `when 'Fixnum'` is the same as the result of the code for the unknown class below `else`, so no problem is occurring for now.
The following patch fixes the issue.
Index: app/helpers/application_helper.rb
===================================================================
--- app/helpers/application_helper.rb (revision 22022)
+++ app/helpers/application_helper.rb (working copy)
@@ -263,7 +263,7 @@
format_time(object)
when 'Date'
format_date(object)
- when 'Fixnum'
+ when 'Integer'
object.to_s
when 'Float'
sprintf "%.2f", object
</diff>Files
Actions