Sha256: ef6343327e2dee2ca2acb7d4b281c19af6ab664f6b38cf339f428624a56d5a0a
Contents?: true
Size: 802 Bytes
Versions: 31
Compression:
Stored size: 802 Bytes
Contents
# encoding: utf-8 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: # # collection.remove( # { "_id" : 1 }, # false # ); class Remove include Deletion, Operations # Remove the document from the database: delegates to the MongoDB # collection remove method. # # @example Remove the document. # Remove.persist # # @return [ true ] Always true. def persist prepare do |doc| collection.find(doc.atomic_selector).remove end end end end end end
Version data entries
31 entries across 31 versions & 2 rubygems