1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #41801 from Shopify/optimize-numeric-to-s

Optimize ActiveSupport::NumericWithFormat#to_s
This commit is contained in:
Jean Boussier 2021-03-31 09:22:43 +02:00 committed by GitHub
commit d612542336
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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