No need to override to_yaml and yaml_initialize methods in ActiveRecord::Core
This commit is contained in:
parent
b65bdb1527
commit
bdc49dcb4e
@ -317,26 +317,6 @@ def inspect
|
||||
"#<#{self.class} #{inspection}>"
|
||||
end
|
||||
|
||||
# Hackery to accomodate Syck. Remove for 4.0.
|
||||
def to_yaml(opts = {}) #:nodoc:
|
||||
if !YAML::ENGINE.syck?
|
||||
super
|
||||
else
|
||||
coder = {}
|
||||
encode_with(coder)
|
||||
YAML.quick_emit(self, opts) do |out|
|
||||
out.map(taguri, to_yaml_style) do |map|
|
||||
coder.each { |k, v| map.add(k, v) }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Hackery to accomodate Syck. Remove for 4.0.
|
||||
def yaml_initialize(tag, coder) #:nodoc:
|
||||
init_with(coder)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Under Ruby 1.9, Array#flatten will call #to_ary (recursively) on each of the elements
|
||||
|
Loading…
Reference in New Issue
Block a user