2015-11-13 13:20:48 -05:00
|
|
|
class MilestonesFinder
|
|
|
|
def execute(projects, params)
|
|
|
|
milestones = Milestone.of_projects(projects)
|
2015-11-30 15:47:44 -05:00
|
|
|
milestones = milestones.reorder("due_date ASC")
|
2015-11-13 13:20:48 -05:00
|
|
|
|
|
|
|
case params[:state]
|
|
|
|
when 'closed' then milestones.closed
|
|
|
|
when 'all' then milestones
|
|
|
|
else milestones.active
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|