Commit 7a2a5dd3 authored by Rémy Coutable's avatar Rémy Coutable Committed by Douglas Barbosa Alexandre

Merge branch 'permit-uploadedfile-scalar' into 'master'

Monkey-patch StrongParameters for ::UploadedFile

Closes gitlab-ee#1451

See merge request !8299
parent 1af7a910
Rails.application.configure do |config| Rails.application.configure do |config|
config.middleware.use(Gitlab::Middleware::Multipart) config.middleware.use(Gitlab::Middleware::Multipart)
end 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment