jnunemaker/mongomapper — Issue #373: Embedded documents show up as nil in Documents
Author: burningTyger
Created: 2011-12-31 09:34:03+00:00
State: open

Seems like this has been brought up before as an issue but I can't find any solution. Two simple classes like this:

class Address
include MongoMapper::EmbeddedDocument

key :address, String
end

class Person
include MongoMapper::Document

many :addresses
end

person = Person.new
person.addresses << Address.new(:address => 'Home sweet home')
person.save

will end up as:

=> #

However, in my db it is there. But whatever I do I can't access addresses.

I have a current gem and mongodb installed (0.10.1 and 2.0.2)