aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb
diff options
context:
space:
mode:
authorAndrew Mutz <andrew.mutz@gmail.com>2012-05-14 17:47:55 -0700
committerAndrew Mutz <andrew.mutz@gmail.com>2012-05-27 18:14:21 -0700
commit155cd5e6b5f4c787ce01369d0187431c71a0d909 (patch)
tree2caad9e93af633431cca8415d2360e461316a567 /activesupport/lib/active_support/core_ext/big_decimal/conversions.rb
parent523d0f09e4cc3ba46d851e2144587df26fdc7603 (diff)
downloadrails-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.rb9
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