gitlab-org--gitlab-foss/app/finders/milestones_finder.rb
2015-12-03 08:53:34 -06:00

12 lines
298 B
Ruby

class MilestonesFinder
def execute(projects, params)
milestones = Milestone.of_projects(projects)
milestones = milestones.reorder("due_date ASC")
case params[:state]
when 'closed' then milestones.closed
when 'all' then milestones
else milestones.active
end
end
end