Merge pull request #5702 from kevinelliott/feature/20180323-fix-mass-assignment

20180323 Fix Mass Assignment Warning
This commit is contained in:
Guo Xiang Tan 2018-04-02 10:19:25 +08:00 committed by GitHub
commit 87e3779085
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -668,9 +668,10 @@ class TopicsController < ApplicationController
raise 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_keys
raise ActionController::ParameterMissing.new(:operation_type) if operation[:type].blank?
operator = TopicsBulkAction.new(current_user, topic_ids, operation, group: operation[:group])