lib/mongoid/persistence/operations/remove.rb in mongoid-2.8.1 vs lib/mongoid/persistence/operations/remove.rb in mongoid-3.0.0.rc

- old
+ new

@@ -1,9 +1,9 @@ # encoding: utf-8 -module Mongoid #:nodoc: - module Persistence #:nodoc: - module Operations #:nodoc: +module Mongoid + module Persistence + module Operations # Remove is a persistence command responsible for deleting a document from # the database. # # The underlying query resembles the following MongoDB query: @@ -22,10 +22,10 @@ # Remove.persist # # @return [ true ] Always true. def persist prepare do |doc| - collection.remove({ :_id => doc.id }, options) + collection.find({ _id: doc.id }).remove end end end end end