fix #895 by clearing the repeat pattern from todos before the pattern is deleted

This commit is contained in:
Reinier Balt 2010-08-19 11:25:04 +02:00
parent 13ff472bc3
commit 25c3ea9148
2 changed files with 12 additions and 0 deletions

View file

@ -636,6 +636,15 @@ class RecurringTodo < ActiveRecord::Base
self.project = nil
self.save
end
def clear_todos_association
unless todos.nil?
self.todos.each do |t|
t.recurring_todo = nil
t.save
end
end
end
def inc_occurences
self.occurences_count += 1