mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Embedded has_one returns an array with the key pluralized
This commit is contained in:
@@ -101,7 +101,7 @@ module ActiveModel
|
||||
if associated_data.respond_to?(:to_ary)
|
||||
associated_data.map { |elem| association.build_serializer(elem).serializable_hash }
|
||||
else
|
||||
association.build_serializer(associated_data).serializable_hash
|
||||
[association.build_serializer(associated_data).serializable_hash]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def embedded_key
|
||||
name
|
||||
name.pluralize
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user