-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
If I have three models A, B and C, where A has_one B, B belongs to A, and B has_many C:
class A include Mongoid::Document has_one :b end class B include Mongoid::Document belongs_to :a has_many :c end class C include Mongoid::Document belongs_to :b end
Now this doesn't work:
a = A.create c = C.create b = a.create_b :cs => [c]
a and c are created as expected but b is created without the relation with c being created