Make sure that newly created periodic task are not done
This commit is contained in:
parent
2072fbb4d5
commit
1056b86f9d
1 changed files with 3 additions and 2 deletions
|
@ -10,9 +10,10 @@ class PeriodicTaskGroup < ActiveRecord::Base
|
||||||
def create_next_task
|
def create_next_task
|
||||||
template_task = tasks.first
|
template_task = tasks.first
|
||||||
self.next_task_date ||= template_task.due_date + period_days
|
self.next_task_date ||= template_task.due_date + period_days
|
||||||
|
|
||||||
next_task = template_task.dup
|
next_task = template_task.dup
|
||||||
next_task.due_date = next_task_date
|
next_task.due_date = next_task_date
|
||||||
|
next_task.done = false
|
||||||
next_task.save
|
next_task.save
|
||||||
|
|
||||||
self.next_task_date += period_days
|
self.next_task_date += period_days
|
||||||
|
|
Loading…
Reference in a new issue