We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f95f736 commit 343f8b9Copy full SHA for 343f8b9
lib/active_model/serializer/adapter/json_api.rb
@@ -50,7 +50,8 @@ def resource_identifier(serializer)
50
else
51
serializer.object.class.model_name.singular
52
end
53
- id = serializer.object.id.to_s
+ id = serializer.id.to_s if serializer.respond_to?('id')
54
+ id ||= serializer.object.id.to_s
55
56
{ id: id, type: type }
57
0 commit comments