Implement has_one's embed ids include true

This commit is contained in:
Santiago Pastorino
2013-08-14 19:45:05 -03:00
parent 52bb3f6929
commit 516f5bdceb
3 changed files with 24 additions and 4 deletions

View File

@@ -74,7 +74,8 @@ module ActiveModel
self.class._associations.each_with_object({}) do |association, hash|
if association.embed_ids?
hash[association.key] = serialize_ids association
elsif association.embed_objects?
end
if association.embed_objects?
associated_data = send(association.name)
hash[association.embedded_key] = association.build_serializer(associated_data).serializable_hash
end