Add Rails 6 deprecation error message

This commit is contained in:
Stan Hu 2019-02-05 04:47:40 -08:00
parent 41b51c0656
commit e6850f73ae
1 changed files with 7 additions and 0 deletions

View File

@ -3,6 +3,13 @@
# which will be available in Rails 6.
module Gitlab
class ContentDisposition # :nodoc:
# Make sure we remove this patch starting with Rails 6.0.
if Rails.version.start_with?('6.0')
raise <<~MSG
Please remove this file and use `ActionDispatch::Http::ContentDisposition` instead.
MSG
end
def self.format(disposition:, filename:)
new(disposition: disposition, filename: filename).to_s
end