I use Mongoid and Fabrication gems. I have switched to Mongoid.rc7 from beta20 and now I can\'t fabricate document with embedded document:
#Models
class User
in
This is a working solution for embeds_many
with Mongoid.rc7:
Fabricator(:admin_user, :from => :user) do
after_create { |user | user.roles << Fabricate.build(:role, :name => "admin") }
end
For embeds_one
this code works (address embeds one location):
Fabricator(:address) do
location { |address| Fabricate(:location, :address => address) }
end