Making include_associations! a public API

This commit is contained in:
Yehuda Katz 2012-01-11 20:03:48 -07:00
parent 573be9302d
commit fb6af2efbb

View File

@ -366,16 +366,16 @@ module ActiveModel
# object without the root. # object without the root.
def serializable_hash def serializable_hash
node = attributes node = attributes
include_associations!(node) if _embed
if _embed
_associations.each do |attr, klass|
include! attr, :node => node
end
end
node node
end end
def include_associations!(node)
_associations.each do |attr, klass|
include! attr, :node => node
end
end
def include!(name, options={}) def include!(name, options={})
hash = options[:hash] || @options[:hash] hash = options[:hash] || @options[:hash]
node = options[:node] node = options[:node]