mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Save result of calling associated_object in a local var
This commit is contained in:
parent
baa690a01a
commit
c1e710aae1
@ -177,8 +177,10 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def serialize_ids
|
||||
if associated_object
|
||||
id = associated_object.read_attribute_for_serialization(embed_key)
|
||||
object = associated_object
|
||||
|
||||
if object
|
||||
id = object.read_attribute_for_serialization(embed_key)
|
||||
if polymorphic?
|
||||
{
|
||||
:type => polymorphic_key,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user