Add StudyGroups with ExternalUsers only

This commit is contained in:
Sebastian Serth
2018-11-26 17:06:35 +01:00
parent 141450a840
commit b137e64020
12 changed files with 86 additions and 6 deletions

11
app/models/study_group.rb Normal file
View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
class StudyGroup < ApplicationRecord
has_many :study_group_memberships
# Use `ExternalUser` as `source_type` for now.
# Using `User` will lead ActiveRecord to access the inexistent table `users`.
# Issue created: https://github.com/rails/rails/issues/34531
has_many :users, through: :study_group_memberships, source_type: 'ExternalUser'
has_many :submissions
belongs_to :consumer
end