app/models/task_manager/plan.rb in task-manager-0.1.4 vs app/models/task_manager/plan.rb in task-manager-0.1.5

- old
+ new

@@ -59,11 +59,11 @@ status, finished_at = :new, nil end Task.create! do |t| t.name = name - t.data = { x: data[:x], y: data[:y] } + t.data = data.select{ |k, v| !(k.to_s.start_with?('deadline_')) } t.task_type = plan_type t.deadline = calculate_deadline(plan_type, data) t.reminding_at = reminding_at t.status = status t.finished_at = finished_at @@ -116,10 +116,12 @@ when :monthly then now.beginning_of_month when :quarterly then now.beginning_of_quarter when :yearly then now.beginning_of_year end - squeel{ (plan_type == type) & (last_task_created_at <= beginning_at) & (enabled_at <= now) } + squeel{ (plan_type == type) & + ((last_task_created_at <= beginning_at) | (last_task_created_at == nil)) & + (enabled_at <= now) } end end end end