diff options
author | Aman Gupta <aman@tmm1.net> | 2015-01-02 21:04:03 -0800 |
---|---|---|
committer | Aman Gupta <aman@tmm1.net> | 2015-01-02 21:04:03 -0800 |
commit | 98dbc5e3cc248859b8c881dbcd228f8ad0743f21 (patch) | |
tree | ad048e940c0e65430184045ed13b670e4da7073d /activesupport | |
parent | 79e45a8992f02772abc9f368f8c64567c888dad2 (diff) | |
download | rails-98dbc5e3cc248859b8c881dbcd228f8ad0743f21.tar.gz rails-98dbc5e3cc248859b8c881dbcd228f8ad0743f21.tar.bz2 rails-98dbc5e3cc248859b8c881dbcd228f8ad0743f21.zip |
fix yaml compat on ruby 2.2
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/big_decimal/conversions.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb b/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb index 391bdc925d..d2039fcc1e 100644 --- a/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb +++ b/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb @@ -16,7 +16,9 @@ class BigDecimal # # Note that reconstituting YAML floats to native floats may lose precision. def to_yaml(opts = {}) - return super if defined?(YAML::ENGINE) && !YAML::ENGINE.syck? + return super if + (defined?(YAML::ENGINE) && !YAML::ENGINE.syck?) || + (defined?(Psych) && YAML == Psych) YAML.quick_emit(nil, opts) do |out| string = to_s |