-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
class User include Mongoid::Document field :email, type: String embeds_many :cars, cascade_callbacks: true end class Car include Mongoid::Document field :model, type: String field :trunk_items, type: Array, default: Array.new embedded_in :user end
Ran the following command
User.find_by(email:'test_user@test.com').cars.destroy_all
=> 1
I also ran:
test_destroy = User.find_by(email:'test_user@test.com').cars.first.destroy(validate:false)
=> true
But when I run User.find_by(email:'test_user@test.com').cars the embedded document still exists. I'm running mongoid 3.0.18