Fix broken period calculation initialisation
This commit is contained in:
parent
3e1ed8af58
commit
21091e914e
1 changed files with 3 additions and 2 deletions
|
@ -402,8 +402,9 @@ module StopTime::Models
|
||||||
# See also Task#bill_period.
|
# See also Task#bill_period.
|
||||||
def period
|
def period
|
||||||
# FIXME: maybe should be updated_at?
|
# FIXME: maybe should be updated_at?
|
||||||
return [created_at, created_at] if tasks.empty?
|
p = [created_at, created_at]
|
||||||
p = tasks.first.bill_period
|
return p if tasks.empty?
|
||||||
|
|
||||||
tasks.each do |task|
|
tasks.each do |task|
|
||||||
tp = task.bill_period
|
tp = task.bill_period
|
||||||
p[0] = tp[0] if tp[0] < p[0]
|
p[0] = tp[0] if tp[0] < p[0]
|
||||||
|
|
Loading…
Reference in a new issue