module Rewards
  class MilestonesController < Rewards::BaseController

    def index
      authorize Milestone

      objective_id = params['milestone'].try(:[], 'objective_id')
      @milestones =
        if objective_id
          Milestone.find_by_objective_id(objective_id)
        else
          []
        end
    end
  end
end
