From 2991370a4081cfb71533ade113c5aaf1d70bfe06 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 20 Mar 2012 09:51:22 -0700 Subject: bigdecimal can be duped on Ruby 2.0 Conflicts: activesupport/test/core_ext/duplicable_test.rb --- .../lib/active_support/core_ext/object/duplicable.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'activesupport/lib/active_support/core_ext') 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 -- cgit v1.2.3