mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Making include_associations! a public API
This commit is contained in:
parent
573be9302d
commit
fb6af2efbb
@ -366,16 +366,16 @@ module ActiveModel
|
||||
# object without the root.
|
||||
def serializable_hash
|
||||
node = attributes
|
||||
|
||||
if _embed
|
||||
_associations.each do |attr, klass|
|
||||
include! attr, :node => node
|
||||
end
|
||||
end
|
||||
|
||||
include_associations!(node) if _embed
|
||||
node
|
||||
end
|
||||
|
||||
def include_associations!(node)
|
||||
_associations.each do |attr, klass|
|
||||
include! attr, :node => node
|
||||
end
|
||||
end
|
||||
|
||||
def include!(name, options={})
|
||||
hash = options[:hash] || @options[:hash]
|
||||
node = options[:node]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user