diff --git a/app/models/request_for_comment.rb b/app/models/request_for_comment.rb index af3676c0..aca99938 100644 --- a/app/models/request_for_comment.rb +++ b/app/models/request_for_comment.rb @@ -31,6 +31,6 @@ class RequestForComment < ActiveRecord::Base private def self.row_number_user_sql - select("id, user_id, exercise_id, file_id, requested_at, created_at, updated_at, user_type, row_number() OVER (PARTITION BY user_id ORDER BY created_at DESC) as row_number").to_sql + select("id, user_id, exercise_id, file_id, question, requested_at, created_at, updated_at, user_type, row_number() OVER (PARTITION BY user_id ORDER BY created_at DESC) as row_number").to_sql end end diff --git a/app/views/request_for_comments/index.html.slim b/app/views/request_for_comments/index.html.slim index 80c17bf3..8471cca4 100644 --- a/app/views/request_for_comments/index.html.slim +++ b/app/views/request_for_comments/index.html.slim @@ -5,14 +5,17 @@ h1 = RequestForComment.model_name.human(count: 2) thead tr th = t('activerecord.attributes.request_for_comments.exercise') - th = t('activerecord.attributes.request_for_comments.execution_environment') + th = t('activerecord.attributes.request_for_comments.question') th = t('activerecord.attributes.request_for_comments.username') th = t('activerecord.attributes.request_for_comments.requested_at') tbody - @request_for_comments.each do |request_for_comment| tr data-id=request_for_comment.id td = link_to(request_for_comment.exercise.title, request_for_comment) - td = request_for_comment.exercise.execution_environment + - if request_for_comment.has_attribute?(:question) + td = request_for_comment.question + - else + td = '-' td = request_for_comment.user.displayname td = request_for_comment.requested_at