diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-20 09:51:22 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-20 09:51:22 -0700 |
commit | 440559f661b55c9cd0492469a31c8b3647ca670a (patch) | |
tree | 9664d4ec7c5b7e2a5d9a18b339035e5b0d7b94dd /activesupport/lib | |
parent | ae88ec4ddafe2604de504a7932693952f3c5aaac (diff) | |
download | rails-440559f661b55c9cd0492469a31c8b3647ca670a.tar.gz rails-440559f661b55c9cd0492469a31c8b3647ca670a.tar.bz2 rails-440559f661b55c9cd0492469a31c8b3647ca670a.zip |
bigdecimal can be duped on Ruby 2.0
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/duplicable.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/duplicable.rb b/activesupport/lib/active_support/core_ext/object/duplicable.rb index 9d044eba71..6c607b0d16 100644 --- a/activesupport/lib/active_support/core_ext/object/duplicable.rb +++ b/activesupport/lib/active_support/core_ext/object/duplicable.rb @@ -104,3 +104,15 @@ class Module false end end + +class BigDecimal + begin + BigDecimal.new('4.56').dup + + def duplicable? + true + end + rescue TypeError + # can't dup, so use superclass implementation + end +end |