-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
I have next classes
<pre><code> class A
include Mongoid::Document
has_many :bs
validates :bs, presence: true
end
class B
include Mongoid::Document
belongs_to :a
end
a = A.new
a.valid? #false
a.bs << B.new
a.valid? #true
B.count #0
A.count #0
a.save
B.count MONGOID-4
A.count MONGOID-4
a.bs = []
a.valid? #false
A.first.bs.count #0, but I expect 1 record to be here
</code></pre>