diff options
author | Andrew White <andrew.white@unboxed.co> | 2016-11-03 15:11:05 +0000 |
---|---|---|
committer | Andrew White <andrew.white@unboxed.co> | 2016-11-03 15:11:05 +0000 |
commit | 707f59042a58d329f8237ba5af1af8bca51e2266 (patch) | |
tree | bb11ac4d27e9e09387921cccbd1e25b49bd3d87c /activerecord/lib | |
parent | 7cef8061ab98261887001f8c6fba3f52a85dbaa8 (diff) | |
download | rails-707f59042a58d329f8237ba5af1af8bca51e2266.tar.gz rails-707f59042a58d329f8237ba5af1af8bca51e2266.tar.bz2 rails-707f59042a58d329f8237ba5af1af8bca51e2266.zip |
Tweak conditionals on YAML handling
There's no YAML::ENGINE constant in Ruby 1.8 and Ruby 2.2+ but
the former still needs to use the deprecated Syck behavior.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 181c072211..77ad428685 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -648,10 +648,10 @@ module ActiveRecord #:nodoc: "#<#{self.class} #{inspection}>" end - if YAML.const_defined?(:ENGINE) + if RUBY_VERSION < '2.2' # Hackery to accomodate Syck. Remove for 4.0. def to_yaml(opts = {}) #:nodoc: - if !YAML::ENGINE.syck? + if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck? super else coder = {} |