diff --git a/app/models/user.rb b/app/models/user.rb index 469436e9e3f..8ef8ecda797 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -91,7 +91,7 @@ class User < ActiveRecord::Base scope :alphabetically, order('name ASC') scope :in_team, ->(team){ where(id: team.member_ids) } scope :not_in_team, ->(team){ where('users.id NOT IN (:ids)', ids: team.member_ids) } - scope :potential_team_members, ->(team) { team.members.any? ? active : active.not_in_team(team) } + scope :potential_team_members, ->(team) { team.members.any? ? active.not_in_team(team) : active } # # Class methods