-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
Hi there, here is my test code:
class A include Mongoid::Document embeds_many :bs, cascade_callbacks: true end class B include Mongoid::Document embedded_in :a validate { puts "validate from B object" } end a = A.new a.bs.build() a.valid? # Output Validate from B object Validate from B object => true
The validate method has been called twice. After I removing the cascade_callbacks: true option, it seems work well.
I don't think there is any need to call the validate method repeatedly.