use submission from model
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
class RequestForComment < ActiveRecord::Base
|
class RequestForComment < ActiveRecord::Base
|
||||||
include Creation
|
include Creation
|
||||||
|
belongs_to :submission
|
||||||
belongs_to :exercise
|
belongs_to :exercise
|
||||||
belongs_to :file, class_name: 'CodeOcean::File'
|
belongs_to :file, class_name: 'CodeOcean::File'
|
||||||
|
|
||||||
@ -13,10 +14,6 @@ class RequestForComment < ActiveRecord::Base
|
|||||||
self.requested_at = Time.now
|
self.requested_at = Time.now
|
||||||
end
|
end
|
||||||
|
|
||||||
def submission
|
|
||||||
Submission.find(file.context_id)
|
|
||||||
end
|
|
||||||
|
|
||||||
# not used right now, finds the last submission for the respective user and exercise.
|
# 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.
|
# might be helpful to check whether the exercise has been solved in the meantime.
|
||||||
def last_submission
|
def last_submission
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<p class="list-group-item-text">
|
<p class="list-group-item-text">
|
||||||
<%
|
<%
|
||||||
user = @request_for_comment.user
|
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 %>
|
<%= user.displayname %> | <%= @request_for_comment.created_at.localtime %>
|
||||||
</p>
|
</p>
|
||||||
|
Reference in New Issue
Block a user