Follow-up from "For milestone filters, treat `Any` as `No filter`"

The following discussion from !14586 (merged) should be addressed:

  • @ashmckenzie started a discussion: (+1 comment)

    One for a follow-up Issue maybe but I feel we should have constants for nil, -1, -2 etc here, so we can re-use in specs, e.g:

    class Milestone < ApplicationRecord
      MILESTONE_NONE = -1
      MILESTONE_ANY = nil
      MILESTONE_UPCOMING = -2
      MILESTONE_STARTED = -3
    
      MilestoneStruct = Struct.new(:title, :name, :id)
      None = MilestoneStruct.new('No Milestone', 'No Milestone', MILESTONE_NONE)
      Any = MilestoneStruct.new('Any Milestone', '', MILESTONE_ANY)
      Upcoming = MilestoneStruct.new('Upcoming', '#upcoming', MILESTONE_UPCOMING)
      Started = MilestoneStruct.new('Started', '#started', MILESTONE_STARTED)
    end
Assignee Loading
Time tracking Loading