From 3b42c267a6299b7aeed8c3309dae49b5b7b3f9e0 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 19 Mar 2013 18:07:14 +0200 Subject: [PATCH] Dont show blocked users in autocomplete --- app/assets/javascripts/users_select.js.coffee | 1 + lib/api/users.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/assets/javascripts/users_select.js.coffee b/app/assets/javascripts/users_select.js.coffee index 7a39e425..f8049384 100644 --- a/app/assets/javascripts/users_select.js.coffee +++ b/app/assets/javascripts/users_select.js.coffee @@ -24,6 +24,7 @@ $ -> data: (term, page) -> search: term # search term per_page: 10 + active: true private_token: gon.api_token results: (data, page) -> # parse the results into the format expected by Select2. diff --git a/lib/api/users.rb b/lib/api/users.rb index 567750df..125a8624 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -10,6 +10,7 @@ module Gitlab # GET /users get do @users = User.scoped + @users = @users.active if params[:active].present? @users = @users.search(params[:search]) if params[:search].present? present @users, with: Entities::User end