From 440559f661b55c9cd0492469a31c8b3647ca670a 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 --- .../lib/active_support/core_ext/object/duplicable.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'activesupport/lib') 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