Update patch with warning

This commit is contained in:
Matt-Yorkley
2021-02-18 10:57:03 +00:00
parent c8ff745471
commit 2413afa355

View File

@@ -13,12 +13,18 @@ Paperclip.io_adapters.registered_handlers.delete_if do |_proc, adapter_class|
url_adapters.include? adapter_class.to_s
end
# Patches an error for missing method #silence_stream with Rails 5.0
# Can be removed after Paperclip is upgraded to 3.5+
module Paperclip
class GeometryDetector
def silence_stream(_stream, &block)
yield
if Paperclip::VERSION.to_f < 3.5
if Rails::VERSION::MAJOR > 4
# Patches an error for missing method #silence_stream with Rails 5.0
# Can be removed after Paperclip is upgraded to 3.5+
module Paperclip
class GeometryDetector
def silence_stream(_stream, &block)
yield
end
end
end
end
else
Rails.logger.warn "The Paperclip::GeometryDetector patch can now be removed."
end