Module: MongoMapper::EmbeddedDocument

Defined in:
lib/mongo_mapper/embedded_document.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(model) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/mongo_mapper/embedded_document.rb', line 3

def self.included(model)
  model.class_eval do
    extend ClassMethods
    include InstanceMethods
    
    extend Associations::ClassMethods
    include Associations::InstanceMethods

    include RailsCompatibility::EmbeddedDocument
    include Validatable
    include Serialization

    extend Validations::Macros

    key :_id, ObjectId
    attr_accessor :_root_document
  end
end