Merge pull request #74 from openHPI/rfc_cleanup

use submission from model
This commit is contained in:
rteusner
2016-07-15 16:18:44 +02:00
committed by GitHub
2 changed files with 2 additions and 5 deletions

View File

@@ -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

View File

@@ -3,7 +3,7 @@
<p class="list-group-item-text">
<%
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 %>
</p>