Default nil associations to [] when embedding in root #502

Closed
wants to merge 1 commit into
from

Projects

None yet

4 participants

@joefiorini

See #501

@dmarkow dmarkow commented on the diff Feb 24, 2014
lib/active_model/serializer.rb
@@ -157,7 +157,7 @@ def embedded_in_root_associations
if hash.has_key?(key)
hash[key].concat(serialized_data).uniq!
@dmarkow
dmarkow Feb 24, 2014

If you have multiple associations using the same root element, there's a chance you would run into serialized_data being nil here too; it should probably get the same serialized_data || [] treatment.

@MSch
MSch commented Mar 13, 2014

I think that's fixed by 8ca4d4f

@steveklabnik
Contributor

Yes, it seems that commit fixes this. Please correct me if I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment