diff --git a/app/models/request_for_comment.rb b/app/models/request_for_comment.rb index cd57c5c2..63d932fc 100644 --- a/app/models/request_for_comment.rb +++ b/app/models/request_for_comment.rb @@ -1,5 +1,6 @@ class RequestForComment < ActiveRecord::Base include Creation + belongs_to :submission belongs_to :exercise belongs_to :file, class_name: 'CodeOcean::File' @@ -13,10 +14,6 @@ class RequestForComment < ActiveRecord::Base self.requested_at = Time.now end - def submission - Submission.find(file.context_id) - end - # not used right now, finds the last submission for the respective user and exercise. # might be helpful to check whether the exercise has been solved in the meantime. def last_submission diff --git a/app/views/request_for_comments/show.html.erb b/app/views/request_for_comments/show.html.erb index c1d71672..4089d878 100644 --- a/app/views/request_for_comments/show.html.erb +++ b/app/views/request_for_comments/show.html.erb @@ -3,7 +3,7 @@
<% user = @request_for_comment.user - submission = @request_for_comment.last_submission_before_creation + submission = @request_for_comment.submission %> <%= user.displayname %> | <%= @request_for_comment.created_at.localtime %>