Class: MilestonesFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/milestones_finder.rb

Instance Method Summary collapse

Instance Method Details

#execute(projects, params) ⇒ Object


2
3
4
5
6
7
8
9
10
11
# File 'app/finders/milestones_finder.rb', line 2

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