# File lib/couchrest/model/persistence.rb, line 30 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