machinist_mongo icon indicating copy to clipboard operation
machinist_mongo copied to clipboard

Mongoid references_many and make

Open ian opened this issue 14 years ago • 0 comments

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

ian avatar Sep 24 '10 23:09 ian