lib/Limits.rb in taskjuggler-0.0.2 vs lib/Limits.rb in taskjuggler-0.0.3
- old
+ new
@@ -118,11 +118,13 @@
end
# The objects need access to some project specific data like the project
# period.
def setProject(project)
- raise "Cannot change project after limits have been set!" unless @limits.empty?
+ unless @limits.empty?
+ raise "Cannot change project after limits have been set!"
+ end
@project = project
end
# Reset all counter for all limits.
def reset
@@ -172,16 +174,16 @@
upper = true
when 'dailymin'
period = 60 * 60 * 24
upper = false
when 'weeklymax'
- interval.start = interval.start.beginOfWeek(@project['weekstartsmonday'])
- interval.end = interval.end.beginOfWeek(@project['weekstartsmonday'])
+ interval.start = interval.start.beginOfWeek(@project['weekStartsMonday'])
+ interval.end = interval.end.beginOfWeek(@project['weekStartsMonday'])
period = 60 * 60 * 24 * 7
upper = true
when 'weeklymin'
- interval.start = interval.start.beginOfWeek(@project['weekstartsmonday'])
- interval.end = interval.end.beginOfWeek(@project['weekstartsmonday'])
+ interval.start = interval.start.beginOfWeek(@project['weekStartsMonday'])
+ interval.end = interval.end.beginOfWeek(@project['weekStartsMonday'])
period = 60 * 60 * 24 * 7
upper = false
when 'monthlymax'
interval.start = interval.start.beginOfMonth
interval.end = interval.end.beginOfMonth