diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 4c976224fe..e45351943f 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -75,8 +75,6 @@ class GroupsController < ApplicationController # GET /groups/1/edit def edit @group = Group.includes(:members, :users).find(params[:id]) - - set_filters_for_user_autocompleter end # POST /groups diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index c777176af8..498a247620 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -58,9 +58,10 @@ module GroupsHelper ] end - def set_filters_for_user_autocompleter - @autocompleter_filters = [] - @autocompleter_filters.push({ selector: 'status', operator: '=', values: ['active', 'invited'] }) - @autocompleter_filters.push({ selector: 'group', operator: '!', values: [@group.id] }) + def autocompleter_filters(group) + [ + { selector: 'status', operator: '=', values: ['active', 'invited'] }, + { selector: 'group', operator: '!', values: [group.id] } + ] end end diff --git a/app/views/groups/_users.html.erb b/app/views/groups/_users.html.erb index 736d9b6369..2cb9b9f288 100644 --- a/app/views/groups/_users.html.erb +++ b/app/views/groups/_users.html.erb @@ -55,7 +55,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= hidden_field_tag :user_ids, nil %>