mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Implement has_one's embed objects
This commit is contained in:
@@ -75,8 +75,8 @@ module ActiveModel
|
||||
if association.embed_ids?
|
||||
hash[association.key] = serialize_ids association
|
||||
elsif association.embed_objects?
|
||||
# TODO
|
||||
hash
|
||||
associated_data = send(association.name)
|
||||
hash[association.embedded_key] = association.build_serializer(associated_data).serializable_hash
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user