Class CouchRest::Model::Base
In: lib/couchrest/model/base.rb
Parent: CouchRest::Document

Methods

==   eql?   inherited   new   subclasses  

Included Modules

ActiveModel::Conversion Configuration Connection Persistence DocumentQueries ExtendedAttachments Proxyable PropertyProtection Associations Validations Callbacks Designs CastedBy Dirty

External Aliases

new? -> new_record?
new? -> new_document?

Public Class methods

Instantiate a new CouchRest::Model::Base by preparing all properties using the provided document hash.

Options supported:

  • :directly_set_attributes, true when data comes directly from database
  • :database, provide an alternative database

If a block is provided the new model will be passed into the block so that it can be populated.

Public Instance methods

Compare this model with another by confirming to see if the IDs and their databases match!

Camparison of the database is required in case the model has been proxied or loaded elsewhere.

A Basic CouchRest document will only ever compare using a Hash comparison on the attributes.

eql?(other)

Alias for #==

[Validate]