Always use user object instead of ID and Type

This commit is contained in:
Sebastian Serth
2023-08-25 23:59:24 +02:00
parent 8ba5d5a984
commit 235bf771fe
11 changed files with 16 additions and 28 deletions

View File

@ -23,8 +23,9 @@ class EventsController < ApplicationController
def event_params
# The file ID processed here is the context of the exercise (template),
# not in the context of the submission!
params[:event]&.permit(:category, :data, :exercise_id, :file_id)
&.merge(user_id: current_user&.id, user_type: current_user&.class&.name)
params[:event]
&.permit(:category, :data, :exercise_id, :file_id)
&.merge(user: current_user)
end
private :event_params
end