diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-20 09:51:22 -0700 |
---|---|---|
committer | Arun Agrawal <arunagw@gmail.com> | 2012-04-10 21:06:17 +0530 |
commit | 2991370a4081cfb71533ade113c5aaf1d70bfe06 (patch) | |
tree | dbd95ffb9bac9e8c2e2121e516f1cc5c10d3abd4 /activesupport/lib | |
parent | ca0c0a20ac8efd0c3332e9d03d1fdf63eaac5eea (diff) | |
download | rails-2991370a4081cfb71533ade113c5aaf1d70bfe06.tar.gz rails-2991370a4081cfb71533ade113c5aaf1d70bfe06.tar.bz2 rails-2991370a4081cfb71533ade113c5aaf1d70bfe06.zip |
bigdecimal can be duped on Ruby 2.0
Conflicts:
activesupport/test/core_ext/duplicable_test.rb
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 |