Make embed nil ids work

This commit is contained in:
Santiago Pastorino
2013-09-16 12:40:49 -03:00
parent cad8fafa60
commit dbf512c14c
2 changed files with 13 additions and 1 deletions

View File

@@ -161,7 +161,7 @@ module ActiveModel
if associated_data.respond_to?(:to_ary)
associated_data.map { |elem| elem.send(association.embed_key) }
else
associated_data.send(association.embed_key)
associated_data.send(association.embed_key) if associated_data
end
end