Make comments available to RFC

This commit is contained in:
Maximilian Grundke
2017-06-09 14:39:33 +02:00
parent e4d1f57164
commit 30375a4909
2 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,8 @@ class RequestForComment < ActiveRecord::Base
belongs_to :exercise belongs_to :exercise
belongs_to :file, class_name: 'CodeOcean::File' belongs_to :file, class_name: 'CodeOcean::File'
has_many :comments, through: :submission
scope :unsolved, -> { where(solved: [false, nil]) } scope :unsolved, -> { where(solved: [false, nil]) }
def self.last_per_user(n = 5) def self.last_per_user(n = 5)

View File

@ -8,6 +8,7 @@ class Submission < ActiveRecord::Base
belongs_to :exercise belongs_to :exercise
has_many :testruns has_many :testruns
has_many :comments, through: :files
delegate :execution_environment, to: :exercise delegate :execution_environment, to: :exercise