mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
has_one serialized objects shouldn't be wrapped in an array and it's key is singular
This commit is contained in:
@@ -12,7 +12,7 @@ module ActiveModel
|
||||
@embed_in_root = @embed_ids && (options[:include] || SETTINGS[:include])
|
||||
@embed_key = options[:embed_key] || :id
|
||||
@key = options[:key]
|
||||
@embedded_key = options[:root]
|
||||
@embedded_key = options[:root] || name
|
||||
|
||||
self.serializer_class = @options[:serializer]
|
||||
end
|
||||
@@ -41,7 +41,6 @@ module ActiveModel
|
||||
def initialize(*args)
|
||||
super
|
||||
@key ||= "#{name}_id"
|
||||
@embedded_key ||= name.pluralize
|
||||
end
|
||||
end
|
||||
|
||||
@@ -49,7 +48,6 @@ module ActiveModel
|
||||
def initialize(*args)
|
||||
super
|
||||
@key ||= "#{name.singularize}_ids"
|
||||
@embedded_key ||= name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user