mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Update patch with warning
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user