1

I am using machinist and mongoid. How can I generate blueprint for embeds_many association. Mongoid embeds_many association embeds the hash of array. So I just started like this:

 User.blueprint do
   address { :address1 => "address", :address2 => 'next address'}
 end

Any Ideas?

earlonrails
  • 4,966
  • 3
  • 32
  • 47
kriysna
  • 6,118
  • 7
  • 30
  • 30
  • Is this Ruby code? It looks like it, but I don't actually know Ruby. You should add whatever language this is to the tags. – Phil Miller Jul 19 '10 at 03:31

2 Answers2

2

I Just tried in this way and worked

User.blueprint do   
 addresses {Address.make} 
end
kriysna
  • 6,118
  • 7
  • 30
  • 30
0

How about this?

User.blueprint do
   address { [{:address1 => "address"} , {:address2 => 'next address'}]}
end
Matta
  • 26
  • 1