use submission from model

This commit is contained in:
Ralf Teusner
2016-07-14 16:59:42 +02:00
parent 519581f82a
commit 39a253997d
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