started implementing teams

This commit is contained in:
Hauke Klement
2015-01-28 12:28:09 +01:00
parent cf346e2271
commit dd624b26c8
25 changed files with 355 additions and 3 deletions

View File

@ -7,6 +7,7 @@ class Exercise < ActiveRecord::Base
belongs_to :execution_environment
has_many :submissions
belongs_to :team
has_many :users, source_type: ExternalUser, through: :submissions
scope :with_submissions, -> { where('id IN (SELECT exercise_id FROM submissions)') }