aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-03-20 09:51:22 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-03-20 09:51:22 -0700
commit440559f661b55c9cd0492469a31c8b3647ca670a (patch)
tree9664d4ec7c5b7e2a5d9a18b339035e5b0d7b94dd /activesupport/lib
parentae88ec4ddafe2604de504a7932693952f3c5aaac (diff)
downloadrails-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.rb12
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