A platform for community discussion. Free, open, simple.
Explicit param permit and assignment cleanup.
Kevin Elliottfa0868fc3f7a
diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rbindex 9f6467212d2..db5ab9ae356 100644--- a/app/controllers/topics_controller.rb+++ b/app/controllers/topics_controller.rb@@ -668,9 +668,10 @@ class TopicsController < ApplicationControllerraise ActionController::ParameterMissing.new(:topic_ids)end- operation = params.require(:operation)- operation.permit!- operation = operation.to_h.symbolize_keys+ operation = params+ .require(:operation)+ .permit(:type, :group, :category_id, :notification_level_id, :tags)+ .to_h.symbolize_keysraise ActionController::ParameterMissing.new(:operation_type) if operation[:type].blank?operator = TopicsBulkAction.new(current_user, topic_ids, operation, group: operation[:group])