Merge pull request #3406 from docwhat/in_projects

Fixed UsersProject.in_projects
This commit is contained in:
Dmitriy Zaporozhets 2013-03-30 15:03:44 -07:00
commit 1c5a393c95
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