diff --git a/core/lib/spree/app_configuration.rb b/core/lib/spree/app_configuration.rb index 4af7687f457..605cc1e68c0 100644 --- a/core/lib/spree/app_configuration.rb +++ b/core/lib/spree/app_configuration.rb @@ -491,6 +491,18 @@ def payment_canceller # @return [Module] a module that can be included into Spree::Image to allow attachments # Enumerable of images adhering to the present_image_class interface class_name_attribute :image_attachment_module, default: "Spree::Image::ActiveStorageAttachment" + def image_attachment_module=(value) + if value == 'Spree::Image::PaperclipAttachment' + Spree::Deprecation.warn <<~MSG + Solidus will remove built-in support for Paperclip as image adapter in the next major version. + Please, use the provided generator to incorporate the current Paperclip adapter in your application with: + + bin/rails g solidus:paperclip_adapter:install + MSG + end + + preferences[:image_attachment_module] = value + end # @!attribute [rw] allowed_image_mime_types # @@ -558,6 +570,19 @@ def payment_canceller # @return [Module] a module that can be included into Spree::Taxon to allow attachments # Enumerable of taxons adhering to the present_taxon_class interface class_name_attribute :taxon_attachment_module, default: "Spree::Taxon::ActiveStorageAttachment" + def image_attachment_module=(value) + if value == 'Spree::Taxon::PaperclipAttachment' + Spree::Deprecation.warn <<~MSG + Solidus will remove built-in support for Paperclip as taxons' image adapter in the next major version. + Please, use the provided generator to incorporate the current Paperclip adapter in your application with: + + bin/rails g solidus:paperclip_adapter:install + MSG + end + + preferences[:image_attachment_module] = value + end + # Configures the absolute path that contains the Solidus engine # migrations. This will be checked at app boot to confirm that all Solidus diff --git a/core/lib/spree/testing_support/dummy_app.rb b/core/lib/spree/testing_support/dummy_app.rb index 5bb32518396..7fce19d65cd 100644 --- a/core/lib/spree/testing_support/dummy_app.rb +++ b/core/lib/spree/testing_support/dummy_app.rb @@ -135,8 +135,10 @@ class Application < ::Rails::Application Spree.load_defaults(Spree.solidus_version) Spree.config do |config| if (ENV['DISABLE_ACTIVE_STORAGE'] == 'true') - config.image_attachment_module = 'Spree::Image::PaperclipAttachment' - config.taxon_attachment_module = 'Spree::Taxon::PaperclipAttachment' + Spree::Deprecation.silence do + config.image_attachment_module = 'Spree::Image::PaperclipAttachment' + config.taxon_attachment_module = 'Spree::Taxon::PaperclipAttachment' + end end end