mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 14:56:50 +00:00
Fix bug preventing id overriding.
This commit is contained in:
parent
f95f7369f0
commit
343f8b96bd
@ -50,7 +50,8 @@ module ActiveModel
|
|||||||
else
|
else
|
||||||
serializer.object.class.model_name.singular
|
serializer.object.class.model_name.singular
|
||||||
end
|
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 }
|
{ id: id, type: type }
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user