machinist_mongo
machinist_mongo copied to clipboard
Mongoid references_many and make
When defining references associations, using "association.make" does not seem to provide the proxy as the reference object
Example (Account has the references_many)
Account.blueprint do
...
end
Page.blueprint do
account {Account.make}
end
account = Account.make :domain => 'test.com'
page = account.pages.make
puts account.id # 4c9d2e9a2249c72332000001
puts page.account.id # 4c9d2e9a2249c72332000003