diff options
author | claudiob <claudiob@gmail.com> | 2014-11-28 18:28:07 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-04 15:54:20 -0300 |
commit | 7926ab1004d2ec9118516445d32c75c9aaacba79 (patch) | |
tree | 85b919ef66e1b3244d520e75dc97756aa37a153b /activesupport/lib | |
parent | b2bb2a462f8950522688e8e0d87a7d32a5863438 (diff) | |
download | rails-7926ab1004d2ec9118516445d32c75c9aaacba79.tar.gz rails-7926ab1004d2ec9118516445d32c75c9aaacba79.tar.bz2 rails-7926ab1004d2ec9118516445d32c75c9aaacba79.zip |
Remove hack to support BigDecimal in Ruby 1.9
Now that Rails requires Ruby >= 2.0, there is no need to check whether
`BigDecimal` exists or not.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/duplicable.rb | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/duplicable.rb b/activesupport/lib/active_support/core_ext/object/duplicable.rb index 665cb0f96d..78b0536491 100644 --- a/activesupport/lib/active_support/core_ext/object/duplicable.rb +++ b/activesupport/lib/active_support/core_ext/object/duplicable.rb @@ -78,17 +78,8 @@ end require 'bigdecimal' class BigDecimal - # Needed to support Ruby 1.9.x, as it doesn't allow dup on BigDecimal, instead - # raises TypeError exception. Checking here on the runtime whether BigDecimal - # will allow dup or not. - begin - BigDecimal.new('4.56').dup - - def duplicable? - true - end - rescue TypeError - # can't dup, so use superclass implementation + def duplicable? + true end end |