From 534f8152c6405db515172a19ec3df35af4606fa4 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 7 Sep 2018 17:16:26 +0300 Subject: [PATCH] Use optionally_search for group labels index page Signed-off-by: Dmitriy Zaporozhets --- app/controllers/groups/labels_controller.rb | 4 ++-- app/models/label.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/groups/labels_controller.rb b/app/controllers/groups/labels_controller.rb index 184808cbfa5..e95123c0933 100644 --- a/app/controllers/groups/labels_controller.rb +++ b/app/controllers/groups/labels_controller.rb @@ -11,8 +11,8 @@ class Groups::LabelsController < Groups::ApplicationController respond_to do |format| format.html do @labels = @group.labels - @labels = @labels.search(params[:search]) if params[:search].present? - @labels = @labels.page(params[:page]) + .optionally_search(params[:search]) + .page(params[:page]) end format.json do render json: LabelSerializer.new.represent_appearance(available_labels) diff --git a/app/models/label.rb b/app/models/label.rb index 96c1515b41a..8db7c3abd10 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -5,6 +5,7 @@ class Label < ActiveRecord::Base include Referable include Subscribable include Gitlab::SQL::Pattern + include OptionallySearch # Represents a "No Label" state used for filtering Issues and Merge # Requests that have no label assigned.