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

@ -22,6 +22,7 @@ module Issuable
scope :opened, where(closed: false)
scope :closed, where(closed: true)
scope :of_group, ->(group) { where(project_id: group.project_ids) }
scope :of_user_team, ->(team) { where(project_id: team.project_ids, assignee_id: team.member_ids) }
scope :assigned, ->(u) { where(assignee_id: u.id)}
scope :recent, order("created_at DESC")