Sha256: 1214cc5a17a9c84e3526d0aa234ee99a969585ff7a0467fb2f0ad8c50bba9049

Contents?: true

Size: 1.27 KB

Versions: 8

Compression:

Stored size: 1.27 KB

Contents

module MongoModel
  class EmbeddedDocument
    def ==(other)
      self.class == other.class && attributes == other.attributes
    end
    
    include Attributes
    include Properties
    
    include Translation
    include Validations
    include Callbacks
    
    include Associations
    
    include AttributeMethods
    include AttributeMethods::Read
    include AttributeMethods::Write
    include AttributeMethods::Query
    include AttributeMethods::BeforeTypeCast
    include AttributeMethods::Protected
    include AttributeMethods::Dirty
    include AttributeMethods::MultiParameterAssignment
    
    include Logging
    include RecordStatus
    include ActiveModelCompatibility
    include Serialization
    include Timestamps
    include PrettyInspect
    include AbstractClass
    include DocumentParent
    
    # Allow Collection class to be used in property definitions
    Collection = MongoModel::Collection
    extend Collection::PropertyDefaults
    
    # Allow Map class to be used in property definitions
    Map = MongoModel::Map
    extend Map::PropertyDefaults
    
    undef_method :type if method_defined?(:type)
    property :type, String, :as => '_type', :default => lambda { |doc| doc.class.name }, :protected => true
    
    self.abstract_class = true
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mongomodel-0.4.1 lib/mongomodel/embedded_document.rb
mongomodel-0.4.0 lib/mongomodel/embedded_document.rb
mongomodel-0.3.6 lib/mongomodel/embedded_document.rb
mongomodel-0.3.5 lib/mongomodel/embedded_document.rb
mongomodel-0.3.4 lib/mongomodel/embedded_document.rb
mongomodel-0.3.3 lib/mongomodel/embedded_document.rb
mongomodel-0.3.2 lib/mongomodel/embedded_document.rb
mongomodel-0.3.1 lib/mongomodel/embedded_document.rb