Commit 70e05801b196a460ec2b1d6f6f096f44d32b7928

Authored by Dmitriy Zaporozhets
1 parent 8016a7bd

fix User.potential_team_members

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/models/user.rb
@@ -91,7 +91,7 @@ class User < ActiveRecord::Base @@ -91,7 +91,7 @@ class User < ActiveRecord::Base
91 scope :alphabetically, order('name ASC') 91 scope :alphabetically, order('name ASC')
92 scope :in_team, ->(team){ where(id: team.member_ids) } 92 scope :in_team, ->(team){ where(id: team.member_ids) }
93 scope :not_in_team, ->(team){ where('users.id NOT IN (:ids)', ids: team.member_ids) } 93 scope :not_in_team, ->(team){ where('users.id NOT IN (:ids)', ids: team.member_ids) }
94 - scope :potential_team_members, ->(team) { team.members.any? ? active : active.not_in_team(team) } 94 + scope :potential_team_members, ->(team) { team.members.any? ? active.not_in_team(team) : active }
95 95
96 # 96 #
97 # Class methods 97 # Class methods