lib/couchrest/model/persistence.rb
# Trigger the callbacks (before, after, around)
# only if the document isn't new
Trigger the callbacks (before, after, around)
only if the document isn't new
Trigger the callbacks ( before after around ) only if the document isn ' t new
def update(options = {})
        raise "Cannot save a destroyed document!" if destroyed?
        raise "Calling #{self.class.name}#update on document that has not been created!" if new?
        return false unless perform_validations(options)
        return true if !self.disable_dirty && !self.changed?
        run_callbacks :update do
          run_callbacks :save do
            result = database.save_doc(self)
            ret = result["ok"] == true
            @changed_attributes.clear if ret && @changed_attributes
            ret
          end
        end
      end
def update ( options = { } ) raise "Cannot save a destroyed document!" if destroyed? raise "Calling #{self.class.name}#update on document that has not been created!" if new? return false unless perform_validations ( options ) return true if ! self . disable_dirty && ! self . changed? run_callbacks :update do run_callbacks :save do result = database . save_doc ( self ) ret = result [ "ok" ] == true @changed_attributes . clear if ret && @changed_attributes ret end end end
Trigger the callbacks (before, after, around)
only if the document isn't new
Trigger the callbacks ( before after around ) only if the document isn ' t new
options