Module: Mongoid::Commands

Included in:
Document
Defined in:
lib/mongoid/commands.rb,
lib/mongoid/commands/save.rb,
lib/mongoid/commands/create.rb,
lib/mongoid/commands/delete.rb,
lib/mongoid/commands/destroy.rb,
lib/mongoid/commands/delete_all.rb,
lib/mongoid/commands/destroy_all.rb

Overview

This module is included in the Document to provide all the persistence methods required on the Document object and class. The following methods are provided:

create, create!, delete, delete_all, destroy, destroy_all, save, save!, update_attributes, update_attributes!

These methods will delegate to their respective commands.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Create, Delete, DeleteAll, Destroy, DestroyAll, Save

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



28
29
30
31
32
33
# File 'lib/mongoid/commands.rb', line 28

def self.included(base)
  base.class_eval do
    include InstanceMethods
    extend ClassMethods
  end
end