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
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,