Module: MongoMapper::Document

Defined in:
lib/mongo_mapper/document.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.descendantsObject



25
26
27
# File 'lib/mongo_mapper/document.rb', line 25

def self.descendants
  @descendants ||= Set.new
end

.included(model) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/mongo_mapper/document.rb', line 5

def self.included(model)
  model.class_eval do
    include EmbeddedDocument
    include InstanceMethods
    include Observing
    include Callbacks
    include Dirty
    include RailsCompatibility::Document
    extend Validations::Macros
    extend ClassMethods
    extend Finders

    def self.per_page
      25
    end unless respond_to?(:per_page)
  end

  descendants << model
end