Skip to content
Browse files

No need to check if YAML::ENGINE is defined since ruby 1.9 does that

  • Loading branch information...
1 parent e2e4216 commit 0bf51e9805260243ec0bbe5fca8f8b9364fdd970 Rafael Mendonça França committed Jan 4, 2012
View
2 activerecord/lib/active_record/core.rb
@@ -319,7 +319,7 @@ def inspect
# Hackery to accomodate Syck. Remove for 4.0.
def to_yaml(opts = {}) #:nodoc:
- if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck?
+ if !YAML::ENGINE.syck?
super
else
coder = {}
View
2 activesupport/lib/active_support/core_ext/big_decimal/conversions.rb
@@ -16,7 +16,7 @@ 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 !YAML::ENGINE.syck?
YAML.quick_emit(nil, opts) do |out|
string = to_s
View
2 activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -137,7 +137,7 @@ def encode_with(coder)
end
def to_yaml(*args)
- return super() if defined?(YAML::ENGINE) && !YAML::ENGINE.syck?
+ return super() if !YAML::ENGINE.syck?
to_str.to_yaml(*args)
end
View
2 activesupport/lib/active_support/ordered_hash.rb
@@ -30,7 +30,7 @@ def encode_with(coder)
end
def to_yaml(opts = {})
- if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck?
+ if !YAML::ENGINE.syck?
return super
end
View
2 activesupport/lib/active_support/time_with_zone.rb
@@ -147,7 +147,7 @@ def encode_with(coder)
end
def to_yaml(options = {})
- return super if defined?(YAML::ENGINE) && !YAML::ENGINE.syck?
+ return super if !YAML::ENGINE.syck?
utc.to_yaml(options)
end

0 comments on commit 0bf51e9

Please sign in to comment.
Something went wrong with that request. Please try again.