Commit 8b8fbd4e authored by Douwe Maan's avatar Douwe Maan

Rename confusing methods

parent aafb3661
...@@ -93,7 +93,7 @@ class IssuableFinder ...@@ -93,7 +93,7 @@ class IssuableFinder
params[:milestone_title].present? params[:milestone_title].present?
end end
def no_milestones? def filter_by_no_milestone?
milestones? && params[:milestone_title] == Milestone::None.title milestones? && params[:milestone_title] == Milestone::None.title
end end
...@@ -114,7 +114,7 @@ class IssuableFinder ...@@ -114,7 +114,7 @@ class IssuableFinder
params[:label_name].present? params[:label_name].present?
end end
def no_labels? def filter_by_no_label?
labels? && params[:label_name] == Label::None.title labels? && params[:label_name] == Label::None.title
end end
...@@ -227,7 +227,7 @@ class IssuableFinder ...@@ -227,7 +227,7 @@ class IssuableFinder
def by_milestone(items) def by_milestone(items)
if milestones? if milestones?
if no_milestones? if filter_by_no_milestone?
items = items.where(milestone_id: [-1, nil]) items = items.where(milestone_id: [-1, nil])
else else
items = items.joins(:milestone).where(milestones: { title: params[:milestone_title] }) items = items.joins(:milestone).where(milestones: { title: params[:milestone_title] })
...@@ -243,7 +243,7 @@ class IssuableFinder ...@@ -243,7 +243,7 @@ class IssuableFinder
def by_label(items) def by_label(items)
if labels? if labels?
if no_labels? if filter_by_no_label?
items = items. items = items.
joins("LEFT OUTER JOIN label_links ON label_links.target_type = '#{klass.name}' AND label_links.target_id = #{klass.table_name}.id"). joins("LEFT OUTER JOIN label_links ON label_links.target_type = '#{klass.name}' AND label_links.target_id = #{klass.table_name}.id").
where(label_links: { id: nil }) where(label_links: { id: nil })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment