FIX: invite to message was not allowing groups

Previously we were incorrectly checking mentionable instead of messageable

Also fix edge case where multiple groups sharing a name mean that exact match override is not working

Also cleans up params sent to user selector
This commit is contained in:
Sam
2018-02-13 13:28:29 +11:00
parent 5f8f691e2b
commit b34b1b6fe3
6 changed files with 45 additions and 34 deletions

View File

@ -751,6 +751,7 @@ class UsersController < ApplicationController
if include_groups || groups
groups = Group.search_groups(term, groups: groups)
groups = groups.where(visibility_level: Group.visibility_levels[:public]) if include_groups
groups = groups.order('groups.name asc')
to_render[:groups] = groups.map do |m|
{ name: m.name, full_name: m.full_name }