Explicitly set serializer for associations

Document specifying serializer for assocaition
This commit is contained in:
Gary Gordon
2014-10-24 08:23:07 -04:00
parent 08fbba9087
commit 9f9715801a
6 changed files with 119 additions and 13 deletions

View File

@@ -18,7 +18,6 @@ module ActiveModel
end
else
@hash[@root] = attributes_for_serializer(serializer, @options)
add_resource_links(@hash[@root], serializer)
end
@@ -46,7 +45,7 @@ module ActiveModel
resource[:links] ||= {}
resource[:links][name] = nil
if serializer
if serializer && serializer.object
type = serialized_object_type(serializer)
if name.to_s == type || !type
resource[:links][name] = serializer.id.to_s