Allow configuration of task periods
This commit is contained in:
parent
6e990fed4c
commit
f6c008c79c
7 changed files with 43 additions and 10 deletions
|
|
@ -36,8 +36,8 @@ class Task < ActiveRecord::Base
|
|||
end
|
||||
|
||||
|
||||
# find all tasks in the next week (or another number of days)
|
||||
def self.next_assigned_tasks_for(user, number = 7)
|
||||
# find all tasks in the period (or another number of days)
|
||||
def self.next_assigned_tasks_for(user, number = FoodsoftConfig[:tasks_period_days].to_i)
|
||||
user.tasks.undone.where(assignments: {accepted: true}).
|
||||
where(["tasks.due_date >= ? AND tasks.due_date <= ?", Time.now, number.days.from_now])
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue