Refinements to dirty tracking so always enabled unless loading from the database

This commit is contained in:
Sam Lown 2011-04-20 12:31:46 +02:00
commit b3e8fbadc6
13 changed files with 54 additions and 124 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 if use_dirty? && !self.changed?
return true if !self.changed?
_run_update_callbacks do
_run_save_callbacks do
result = database.save_doc(self)