diff options
-rw-r--r-- | activesupport/lib/active_support/core_ext/big_decimal/conversions.rb | 6 | ||||
-rw-r--r-- | activesupport/test/core_ext/bigdecimal_test.rb | 2 |
2 files changed, 4 insertions, 4 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 22fc7ecf92..074e2eabf8 100644 --- a/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb +++ b/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb @@ -3,10 +3,8 @@ require 'bigdecimal/util' module ActiveSupport module BigDecimalWithDefaultFormat #:nodoc: - DEFAULT_STRING_FORMAT = 'F' - - def to_s(format = nil) - super(format || DEFAULT_STRING_FORMAT) + def to_s(format = 'F') + super(format) end end end diff --git a/activesupport/test/core_ext/bigdecimal_test.rb b/activesupport/test/core_ext/bigdecimal_test.rb index 423a3f2e9d..6e82e3892b 100644 --- a/activesupport/test/core_ext/bigdecimal_test.rb +++ b/activesupport/test/core_ext/bigdecimal_test.rb @@ -5,5 +5,7 @@ class BigDecimalTest < ActiveSupport::TestCase def test_to_s bd = BigDecimal.new '0.01' assert_equal '0.01', bd.to_s + assert_equal '+0.01', bd.to_s('+F') + assert_equal '+0.0 1', bd.to_s('+1F') end end |