If an auto-enter schedule has more than one overdue occurrence, currently only the earliest is entered.
Example
Frequency: Monthly
Next Due: 1 Mar 2014
Current date: 20 May 2014
The above example implies that there are 3 x occurrences overdue (1 Mar, 1 Apr & 1 May).
Currently, the Schedule.auto_enter_overdue method selects the set of schedules where auto_enter => true and next_due_date < now; and enters each.
This would only enter the 1 Mar occurrence.
To ensure that all overdue occurrences are entered, either the Schedule.auto_enter_overdue method needs to internally loop until the next_due_date of each overdue schedule is in the future; or the LoginsController#create action needs to repeatedly call Schedule.auto_enter_overdue until there are no more overdue schedules.
If an auto-enter schedule has more than one overdue occurrence, currently only the earliest is entered.
Example
Frequency: Monthly Next Due: 1 Mar 2014 Current date: 20 May 2014
The above example implies that there are 3 x occurrences overdue (1 Mar, 1 Apr & 1 May).
Currently, the
Schedule.auto_enter_overdue
method selects the set ofschedules
whereauto_enter => true
andnext_due_date < now
; and enters each.This would only enter the 1 Mar occurrence.
To ensure that all overdue occurrences are entered, either the
Schedule.auto_enter_overdue
method needs to internally loop until the next_due_date of each overdue schedule is in the future; or theLoginsController#create
action needs to repeatedly callSchedule.auto_enter_overdue
until there are no more overdue schedules.