summaryrefslogtreecommitdiff
path: root/app/finders/milestones_finder.rb
blob: 630c73c2a94bd79f63e89a861614b9fe3a26ad3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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