aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-03-20 09:51:22 -0700
committerArun Agrawal <arunagw@gmail.com>2012-04-10 21:06:17 +0530
commit2991370a4081cfb71533ade113c5aaf1d70bfe06 (patch)
treedbd95ffb9bac9e8c2e2121e516f1cc5c10d3abd4 /activesupport/lib
parentca0c0a20ac8efd0c3332e9d03d1fdf63eaac5eea (diff)
downloadrails-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.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