mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Fix bug preventing id overriding.
This commit is contained in:
parent
f95f7369f0
commit
343f8b96bd
@ -50,7 +50,8 @@ module ActiveModel
|
||||
else
|
||||
serializer.object.class.model_name.singular
|
||||
end
|
||||
id = serializer.object.id.to_s
|
||||
id = serializer.id.to_s if serializer.respond_to?('id')
|
||||
id ||= serializer.object.id.to_s
|
||||
|
||||
{ id: id, type: type }
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user