Mongoid allows Embedded Associations:
embeds_one
/ embedded_in
embeds_many
/ embedded_in
To add an association (lets say the User embeds_many
addresses), add this to your User
file:
embeds_many :addresses
and this to your Address
model file:
embedded_in :user
This will embed Address
in your User
model, adding a addresses
method to your User
class.