diff options
author | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2014-12-30 10:31:59 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2014-12-30 10:31:59 +0000 |
commit | 394e2ec50b066b5e911b749aa13192ab50e703d4 (patch) | |
tree | 21e7c51ff191a24dffd7cb1cb8e32c08e034a63c /lib | |
parent | da9d8279046c7f5f1dfb0972c0c8ac676cfc8b2c (diff) | |
parent | 5d2e637c17d28315185816a32b202ada15a7c77f (diff) | |
download | gitlab-ce-394e2ec50b066b5e911b749aa13192ab50e703d4.tar.gz |
Merge branch 'ajax-group-select' into 'master'
Ajax group select
Helper method for creatins select2 selectbox with ajax query to groups via API
See merge request !1363
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/groups.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb index f0ab6938b1c..a2d915a7eca 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -25,11 +25,14 @@ module API # Example Request: # GET /groups get do - if current_user.admin - @groups = paginate Group - else - @groups = paginate current_user.groups - end + @groups = if current_user.admin + Group.all + else + current_user.groups + end + + @groups = @groups.search(params[:search]) if params[:search].present? + @groups = paginate @groups present @groups, with: Entities::Group end |