Skip to content

Commit d612542

Browse files
authored
Merge pull request rails#41801 from Shopify/optimize-numeric-to-s
Optimize ActiveSupport::NumericWithFormat#to_s
2 parents e9268f7 + 31c20e2 commit d612542

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activesupport/lib/active_support/core_ext/numeric/conversions.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ module NumericWithFormat
107107
# separator: ',',
108108
# significant: false) # => "1,2 Million"
109109
def to_s(format = nil, options = nil)
110+
return super() if format.nil?
111+
110112
case format
111-
when nil
112-
super()
113113
when Integer, String
114114
super(format)
115115
when :phone

0 commit comments

Comments
 (0)