Add subscription model and link it to RFC

This commit is contained in:
Maximilian Grundke
2017-09-06 15:16:47 +02:00
parent f628774995
commit 5aa9edb209
6 changed files with 81 additions and 1 deletions

View File

@ -5,6 +5,8 @@ class RequestForComment < ActiveRecord::Base
belongs_to :file, class_name: 'CodeOcean::File'
has_many :comments, through: :submission
has_many :subscriptions
has_many :subscribers, through: :subscriptions, source: :user, source_type: ExternalUser
scope :unsolved, -> { where(solved: [false, nil]) }