rails/rails — pull request #13911 by davidcelis (2014-02-01 02:09:01+00:00)
Title: Don't require BigDecimal serialization extension

Rails currently provides an extension to BigDecimal that redefines how
it is serialized to YAML. However, as noted in #12467, this does not
work as expected. When ActiveSupport is required, BigDecimal YAML
serialization does not maintain the object type. It instead ends up
serializing the number represented by the BigDecimal itself which, when
loaded by YAML later, becomes a Float:

```ruby
require 'yaml'
require 'bigdecimal'

yaml = BigDecimal('13.37').to_yaml
YAML.load(yaml).class

require 'active_support/all'

yaml = BigDecimal('13.37').to_yaml
YAML.load(yaml).class
```

@tenderlove posits that we should deprecate the custom BigDecimal
serialization and let Ruby handle it. For the time being, users who
require this serialization for backwards compatibility can manually
`require 'active_support/core_ext/big_decimal/conversions'`. I would
agree. So, remove `active_support/core_ext/big_decimal` so that this
extension is no longer required along with `active_support/all`.

This will close #12467 and deprecate the custom BigDecimal#to_yaml.

Signed-off-by: David Celis