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

Monkey-patch StrongParameters for ::UploadedFile

Closes gitlab-ee#1451

See merge request !8299
This commit is contained in:
Rémy Coutable 2016-12-23 19:04:21 +00:00
commit 09af88336d
1 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,19 @@
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