Commit 70e05801 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

fix User.potential_team_members

parent 8016a7bd
...@@ -91,7 +91,7 @@ class User < ActiveRecord::Base ...@@ -91,7 +91,7 @@ class User < ActiveRecord::Base
scope :alphabetically, order('name ASC') scope :alphabetically, order('name ASC')
scope :in_team, ->(team){ where(id: team.member_ids) } 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 :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 # Class methods
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment