aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/big_decimal/conversions.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/big_decimal/conversions.rb4
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