lib/couchrest/model/persistence.rb
def create(options = {})
        return false unless perform_validations(options)
        run_callbacks :create do
          run_callbacks :save do
            set_unique_id if new? && self.respond_to?(:set_unique_id)
            result = database.save_doc(self)
            ret = (result["ok"] == true) ? self : false
            @changed_attributes.clear if ret && @changed_attributes
            ret
          end
        end
      end
# Create the document. Validation is enabled by default and will return
# false if the document is not valid. If all goes well, the document will
# be returned.
Create the document. Validation is enabled by default and will return
false if the document is not valid. If all goes well, the document will
be returned.
Create the document . Validation is enabled by default and will return false if the document is not valid . If all goes well the document will be returned .
def create(options = {})
        return false unless perform_validations(options)
        run_callbacks :create do
          run_callbacks :save do
            set_unique_id if new? && self.respond_to?(:set_unique_id)
            result = database.save_doc(self)
            ret = (result["ok"] == true) ? self : false
            @changed_attributes.clear if ret && @changed_attributes
            ret
          end
        end
      end
def create ( options = { } ) return false unless perform_validations ( options ) run_callbacks :create do run_callbacks :save do set_unique_id if new? && self . respond_to? ( :set_unique_id ) result = database . save_doc ( self ) ret = ( result [ "ok" ] == true ) ? self : false @changed_attributes . clear if ret && @changed_attributes ret end end end
Create the document.
Create the document .
options