Added UserTeam core models (team and m-t-m relationships) and updated other models

This commit is contained in:
Andrey Kumanyaev 2013-01-19 21:06:50 +04:00 committed by Dmitriy Zaporozhets
parent f6c482c06f
commit 8a86fe7bb0
14 changed files with 248 additions and 28 deletions

View file

@ -39,7 +39,10 @@ class UsersProject < ActiveRecord::Base
scope :reporters, where(project_access: REPORTER)
scope :developers, where(project_access: DEVELOPER)
scope :masters, where(project_access: MASTER)
scope :in_project, ->(project) { where(project_id: project.id) }
scope :in_projects, ->(projects) { where(project_id: projects.map(&:id)) }
scope :with_user, ->(user) { where(user_id: user.id) }
class << self