Skip to content

Commit

Permalink
#16 checking for nil due date
Browse files Browse the repository at this point in the history
  • Loading branch information
nutso committed Dec 31, 2013
1 parent 641cf9c commit 67f4987
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/recurring_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def next_scheduled_recurrence

# whether a recurrence needs to be added
def need_to_recur?
if(fixed_schedule and (issue.due_date + recurrence_pattern) <= (Time.now.to_date + 1.day)) then true else issue.closed? end
if(fixed_schedule and (previous_date_for_recurrence + recurrence_pattern) <= (Time.now.to_date + 1.day)) then true else issue.closed? end
end

# check whether a recurrence is needed, and add one if not
Expand Down Expand Up @@ -94,6 +94,6 @@ def self.add_recurrences!
# for a fixed schedule, this is the due date
# for a relative schedule, this is the date closed
def previous_date_for_recurrence
if fixed_schedule then issue.due_date else issue.closed_on end
if fixed_schedule and !issue.due_date.nil? then issue.due_date else issue.closed_on end
end
end

0 comments on commit 67f4987

Please sign in to comment.