We've moved discussions to Discord

Scoping @mentions to only users in account

Tim Dowling
I am able to @ mention users from other accounts, even when they don't belong to an account. Is there a way to scope the @ mentions so there's no leakage?
Tim Dowling
Sorry team, sorted it, adding my solution in the mentions controller below if others need it...

def index
    @scoped_user = User.includes(:account_users).where(:account_users => {account_id: ActsAsTenant.current_tenant.id})
    @users = @scoped_user.search_by_full_name(params[:query]).with_attached_avatar

    respond_to do |format|
      format.json
    end
  end
Notifications
You’re not receiving notifications from this thread.