gitlab-org--gitlab-foss/app/finders/milestones_finder.rb
Dmitriy Zaporozhets 8a03cb8744
Lets add more tests to Milestones services
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-16 14:39:19 +01:00

12 lines
296 B
Ruby

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