lib/jsonapi/resource_serializer.rb in jsonapi-resources-0.3.0.pre2 vs lib/jsonapi/resource_serializer.rb in jsonapi-resources-0.3.0
- old
+ new
@@ -248,9 +248,11 @@
linkage = {}
linkage_id = foreign_key_value(source, association)
if linkage_id
linkage[:type] = format_route(association.type)
linkage[:id] = linkage_id
+ else
+ linkage = nil
end
linkage
end
def has_many_linkage(source, association)