summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-07-28 11:32:50 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-07-31 12:46:37 +0300
commitc0bf3615059869ebc1148ba98140f76b81a651a7 (patch)
treea57781c67c777b4369ab1c04ed0a1d2604565de4
parent8e8cb5b99fb40e0cff4a78a6328ac202108ee83d (diff)
downloadgitlab-ce-c0bf3615059869ebc1148ba98140f76b81a651a7.tar.gz
Move search param check into own method in app/finders/labels_finder.rb
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/finders/labels_finder.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/finders/labels_finder.rb b/app/finders/labels_finder.rb
index de2eeee122d..1d05bf28438 100644
--- a/app/finders/labels_finder.rb
+++ b/app/finders/labels_finder.rb
@@ -65,7 +65,7 @@ class LabelsFinder < UnionFinder
end
def by_search(labels)
- return labels unless params[:search].present?
+ return labels unless search?
labels.search(params[:search])
end
@@ -113,6 +113,10 @@ class LabelsFinder < UnionFinder
params[:only_group_labels]
end
+ def search?
+ params[:search].present?
+ end
+
def title
params[:title] || params[:name]
end