322 shaares
172 liens privés
172 liens privés
Team has and belongs to many users
Users has and belongs to many teams.
Users.all.where('id not in (?)', @team.users.map(&:id)
Returns the list of all users not related to the @team
Team has and belongs to many users
Users has and belongs to many teams.
Users.all.where('id not in (?)', @team.users.map(&:id)
Returns the list of all users not related to the @team