From 1056b86f9d80c6585baf8faebfff449044900d10 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Thu, 26 Jan 2017 20:54:53 +0100 Subject: [PATCH] Make sure that newly created periodic task are not done --- app/models/periodic_task_group.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/periodic_task_group.rb b/app/models/periodic_task_group.rb index 962012c1..93dd0070 100644 --- a/app/models/periodic_task_group.rb +++ b/app/models/periodic_task_group.rb @@ -10,9 +10,10 @@ class PeriodicTaskGroup < ActiveRecord::Base def create_next_task template_task = tasks.first self.next_task_date ||= template_task.due_date + period_days - + 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 self.next_task_date += period_days