Save result of calling associated_object in a local var

This commit is contained in:
Santiago Pastorino 2013-05-14 16:24:59 -07:00
parent baa690a01a
commit c1e710aae1

View File

@ -177,8 +177,10 @@ module ActiveModel
end end
def serialize_ids def serialize_ids
if associated_object object = associated_object
id = associated_object.read_attribute_for_serialization(embed_key)
if object
id = object.read_attribute_for_serialization(embed_key)
if polymorphic? if polymorphic?
{ {
:type => polymorphic_key, :type => polymorphic_key,