-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
Something I found in the code:
in mongoid/persistence.rb
def _remove(options = {})
if Remove.new(self, options).persist
self.destroyed = true
cascading_remove!
end; true
end
in mongoid/paranoia.rb
def _remove(options = {})
now = Time.now
collection.update({ :_id => self.id }, { '$set' => { :deleted_at => Time.now } })
@attributes["deleted_at"] = now
true
end
Paranoia#_remove doesn't trigger cascading_remove!, ergo any associated documents are not "deleted" when deleted documents using Mongoid::Paranoia