# File app/models/change.rb, line 92 def undo(author) @changes = Change.find(:all, :conditions => ["object_path = ? and date < ? and data_changed = ?", self.object_path, self.date, self.data_changed]) if @changes[@changes.length-2] @changes[@changes.length-2].revert(author) #Change the field back to how it was last change. @changes_to_delete = Change.find(:all, :conditions => ["object_path = ? and date >= ? and data_changed = ?", self.object_path, self.date, self.data_changed]) @changes_to_delete.each { |c| c.destroy } #Delete all changes after and including this one end end