Fix Flowr support and generic event framework

This commit is contained in:
Sebastian Serth
2020-10-07 17:28:29 +02:00
parent a5416758eb
commit 398bd67e1c
5 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,6 @@
class EventsController < ApplicationController
# frozen_string_literal: true
class EventsController < ApplicationController
def authorize!
authorize(@event || @events)
end
@ -20,9 +21,10 @@ class EventsController < ApplicationController
end
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)
&.merge(user_id: current_user&.id, user_type: current_user&.class&.name)
end
private :event_params
end