Skip to content
Snippets Groups Projects
Commit f4a2d33a authored by Jacob Vosmaer (GitLab)'s avatar Jacob Vosmaer (GitLab)
Browse files

Monkey-patch StrongParameters for ::UploadedFile

parent 46920f7e
No related branches found
No related tags found
No related merge requests found
Rails.application.configure do |config|
config.middleware.use(Gitlab::Middleware::Multipart)
end
module Gitlab
module StrongParameterScalars
GITLAB_PERMITTED_SCALAR_TYPES = [::UploadedFile]
def permitted_scalar?(value)
super || GITLAB_PERMITTED_SCALAR_TYPES.any? { |type| value.is_a?(type) }
end
end
end
module ActionController
class Parameters
prepend Gitlab::StrongParameterScalars
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment