From 46de692e96c7d4251faae33ab76fd8bd94b1b6b9 Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Tue, 2 Mar 2021 08:55:54 +0100 Subject: [PATCH] Enable ActiveStorage by default for Solidus' in-memory dummy app --- .circleci/config.yml | 6 ++---- core/lib/spree/testing_support/dummy_app.rb | 8 ++++---- core/lib/spree/testing_support/dummy_app/migrations.rb | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e2fe7acb602..7dd7c37a075 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -98,8 +98,6 @@ jobs: postgres: executor: postgres parallelism: ¶llelism 3 - environment: - ENABLE_ACTIVE_STORAGE: true steps: - setup - test @@ -107,8 +105,6 @@ jobs: mysql: executor: mysql parallelism: *parallelism - environment: - ENABLE_ACTIVE_STORAGE: true steps: - setup - test @@ -118,6 +114,7 @@ jobs: parallelism: *parallelism environment: RAILS_VERSION: '~> 6.0.0' + DISABLE_ACTIVE_STORAGE: true steps: - setup - test @@ -127,6 +124,7 @@ jobs: parallelism: *parallelism environment: RAILS_VERSION: '~> 5.2.0' + DISABLE_ACTIVE_STORAGE: true steps: - setup - test diff --git a/core/lib/spree/testing_support/dummy_app.rb b/core/lib/spree/testing_support/dummy_app.rb index 8aad10e67d8..b96ce9652c6 100644 --- a/core/lib/spree/testing_support/dummy_app.rb +++ b/core/lib/spree/testing_support/dummy_app.rb @@ -68,7 +68,7 @@ class Application < ::Rails::Application config.storage_path = Rails.root.join('tmp', 'storage') - if ENV['ENABLE_ACTIVE_STORAGE'] + unless ENV['DISABLE_ACTIVE_STORAGE'] initializer 'solidus.active_storage' do config.active_storage.service_configurations = { test: { @@ -119,9 +119,9 @@ class Application < ::Rails::Application Spree.config do |config| config.mails_from = "store@example.com" - if ENV['ENABLE_ACTIVE_STORAGE'] - config.image_attachment_module = 'Spree::Image::ActiveStorageAttachment' - config.taxon_attachment_module = 'Spree::Taxon::ActiveStorageAttachment' + if ENV['DISABLE_ACTIVE_STORAGE'] + config.image_attachment_module = 'Spree::Image::PaperclipAttachment' + config.taxon_attachment_module = 'Spree::Taxon::PaperclipAttachment' end end diff --git a/core/lib/spree/testing_support/dummy_app/migrations.rb b/core/lib/spree/testing_support/dummy_app/migrations.rb index 37aa5888903..96060a09e66 100644 --- a/core/lib/spree/testing_support/dummy_app/migrations.rb +++ b/core/lib/spree/testing_support/dummy_app/migrations.rb @@ -27,7 +27,7 @@ def auto_migrate ActiveRecord::Base.remove_connection sh 'rake db:reset VERBOSE=false' - if ENV['ENABLE_ACTIVE_STORAGE'] + unless ENV['DISABLE_ACTIVE_STORAGE'] sh 'rake active_storage:install db:migrate VERBOSE=false' end