redirect to RFCs on max score: redirect users to their own RFCs if they are open, fixed wrong usage of user_id (external_id is not used in RFCs, normal id has to be used!).

This commit is contained in:
Ralf Teusner
2016-11-09 17:58:10 +01:00
parent e8f93cb870
commit ff7446fde6
4 changed files with 26 additions and 12 deletions

View File

@ -82,6 +82,7 @@ class RequestForCommentsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def request_for_comment_params
# we are using the current_user.id here, since internal users are not able to create comments. The external_user.id is a primary key and does not require the consumer_id to be unique.
params.require(:request_for_comment).permit(:exercise_id, :file_id, :question, :requested_at, :solved, :submission_id).merge(user_id: current_user.id, user_type: current_user.class.name)
end
end