diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-28 16:12:32 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-07-06 22:39:55 -0400 |
commit | d00cb00d6b62c561da79b3fc0eab579364b3e91c (patch) | |
tree | 7aad204d8f21889c7b9befc078050019521dae1f /app/finders | |
parent | cfd813402deb631bdc4db9af68c6366ff1179f4a (diff) | |
download | gitlab-ce-d00cb00d6b62c561da79b3fc0eab579364b3e91c.tar.gz |
Rename NoMilestone to Milestone::None
Also refactors IssuableFinder to avoid redundant title check.
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/issuable_finder.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 872c63d82bd..ab89aa2c53a 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -10,7 +10,7 @@ # state: 'open' or 'closed' or 'all' # group_id: integer # project_id: integer -# milestone_id: integer +# milestone_title: string # assignee_id: integer # search: string # label_name: string @@ -76,7 +76,7 @@ class IssuableFinder return @milestones if defined?(@milestones) @milestones = - if milestones? && params[:milestone_title] != NoMilestone.title + if milestones? && params[:milestone_title] != Milestone::None.title Milestone.where(title: params[:milestone_title]) else nil @@ -183,12 +183,7 @@ class IssuableFinder def by_milestone(items) if milestones? - # `milestone_title` will still be present when "No Milestone" is selected - if params[:milestone_title] != NoMilestone.title - items = items.where(milestone_id: milestones.try(:pluck, :id)) - else - items = items.where(milestone_id: NoMilestone.id) - end + items = items.where(milestone_id: milestones.try(:pluck, :id)) end items |