mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Merge pull request #728 from rails-api/linked-resources-use-type-as-key
Use type as key for linked resources
This commit is contained in:
@@ -62,7 +62,7 @@ module ActiveModel
|
||||
resource_path = [parent, resource_name].compact.join('.')
|
||||
|
||||
if include_assoc?(resource_path)
|
||||
plural_name = resource_name.to_s.pluralize.to_sym
|
||||
plural_name = serialized_object_type(serializer).pluralize.to_sym
|
||||
attrs = [attributes_for_serializer(serializer, @options)].flatten
|
||||
@top[:linked] ||= {}
|
||||
@top[:linked][plural_name] ||= []
|
||||
|
||||
Reference in New Issue
Block a user