diff options
author | Andrew Mutz <andrew.mutz@gmail.com> | 2012-05-14 17:47:55 -0700 |
---|---|---|
committer | Andrew Mutz <andrew.mutz@gmail.com> | 2012-05-27 18:14:21 -0700 |
commit | 155cd5e6b5f4c787ce01369d0187431c71a0d909 (patch) | |
tree | 2caad9e93af633431cca8415d2360e461316a567 /activesupport/lib/active_support/core_ext/big_decimal/conversions.rb | |
parent | 523d0f09e4cc3ba46d851e2144587df26fdc7603 (diff) | |
download | rails-155cd5e6b5f4c787ce01369d0187431c71a0d909.tar.gz rails-155cd5e6b5f4c787ce01369d0187431c71a0d909.tar.bz2 rails-155cd5e6b5f4c787ce01369d0187431c71a0d909.zip |
Moving NumberHelpers from ActionView to ActiveSupport
Diffstat (limited to 'activesupport/lib/active_support/core_ext/big_decimal/conversions.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/big_decimal/conversions.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb b/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb index 3ec7e576c8..5dc5710c53 100644 --- a/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb +++ b/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb @@ -17,8 +17,13 @@ class BigDecimal end DEFAULT_STRING_FORMAT = 'F' - def to_formatted_s(format = DEFAULT_STRING_FORMAT) - _original_to_s(format) + def to_formatted_s(*args) + if args[0].is_a?(Symbol) + super + else + format = args[0] || DEFAULT_STRING_FORMAT + _original_to_s(format) + end end alias_method :_original_to_s, :to_s alias_method :to_s, :to_formatted_s |