Fixed UsersProject.in_projects

I discovered while trying to use UserTeam#remove_member() that
UsersProject.in_projects was broken.  So I wrote test cases to test what
I was trying to do and fixed the underlying problem.
This commit is contained in:
Christian Höltje 2013-03-26 10:19:55 -04:00
parent 58a1ed6dd3
commit b8502cbaee
2 changed files with 21 additions and 2 deletions

View file

@ -38,7 +38,7 @@ class UsersProject < ActiveRecord::Base
scope :masters, -> { where(project_access: MASTER) }
scope :in_project, ->(project) { where(project_id: project.id) }
scope :in_projects, ->(projects) { where(project_id: project_ids) }
scope :in_projects, ->(projects) { where(project_id: projects.map { |p| p.id }) }
scope :with_user, ->(user) { where(user_id: user.id) }
class << self