mirror of https://github.com/rails/rails
Merge pull request #41801 from Shopify/optimize-numeric-to-s
Optimize ActiveSupport::NumericWithFormat#to_s
This commit is contained in:
commit
d612542336
|
@ -107,9 +107,9 @@ module ActiveSupport
|
|||
# separator: ',',
|
||||
# significant: false) # => "1,2 Million"
|
||||
def to_s(format = nil, options = nil)
|
||||
return super() if format.nil?
|
||||
|
||||
case format
|
||||
when nil
|
||||
super()
|
||||
when Integer, String
|
||||
super(format)
|
||||
when :phone
|
||||
|
|
Loading…
Reference in New Issue