some speed optimisations. added 'use_dirty' configuration variable

This commit is contained in:
Andrew Williams 2011-03-03 17:58:57 +10:30
parent ce2e2fc9a6
commit dcf43e3641
13 changed files with 184 additions and 69 deletions

View file

@ -30,7 +30,7 @@ module CouchRest
def update(options = {})
raise "Calling #{self.class.name}#update on document that has not been created!" if self.new?
return false unless perform_validations(options)
return true unless self.changed?
return true if use_dirty? && !self.changed?
_run_update_callbacks do
_run_save_callbacks do
result = database.save_doc(self)