Sha256: 810b562fbef78180572a09b94a8125553d9f0cb634b23e1cfb7343cc5c99b861

Contents?: true

Size: 1.53 KB

Versions: 6

Compression:

Stored size: 1.53 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 Observing if defined?(ActiveModel::Observing)
    
    include Associations
    
    include AttributeMethods
    include AttributeMethods::Read
    include AttributeMethods::Write
    include AttributeMethods::Query
    include AttributeMethods::BeforeTypeCast
    include AttributeMethods::Protected
    include AttributeMethods::Dirty
    include AttributeMethods::Nested
    include AttributeMethods::MultiParameterAssignment
    include AttributeMethods::Forbidden if defined?(ActiveModel::ForbiddenAttributesProtection)
    
    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

ActiveSupport::run_load_hooks(:mongomodel, MongoModel::EmbeddedDocument)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mongomodel-0.5.5 lib/mongomodel/embedded_document.rb
mongomodel-0.5.4 lib/mongomodel/embedded_document.rb
mongomodel-0.5.3 lib/mongomodel/embedded_document.rb
mongomodel-0.5.2 lib/mongomodel/embedded_document.rb
mongomodel-0.5.1 lib/mongomodel/embedded_document.rb
mongomodel-0.5.0 lib/mongomodel/embedded_document.rb