Skip to content

Commit

Permalink
Enable ActiveStorage by default for Solidus' in-memory dummy app
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyadsl committed Mar 2, 2021
1 parent 93bfdb4 commit 09b74f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,13 @@ jobs:
postgres:
executor: postgres
parallelism: &parallelism 3
environment:
ENABLE_ACTIVE_STORAGE: true
steps:
- setup
- test

mysql:
executor: mysql
parallelism: *parallelism
environment:
ENABLE_ACTIVE_STORAGE: true
steps:
- setup
- test
Expand All @@ -118,6 +114,7 @@ jobs:
parallelism: *parallelism
environment:
RAILS_VERSION: '~> 6.0.0'
DISABLE_ACTIVE_STORAGE: true
steps:
- setup
- test
Expand All @@ -127,6 +124,7 @@ jobs:
parallelism: *parallelism
environment:
RAILS_VERSION: '~> 5.2.0'
DISABLE_ACTIVE_STORAGE: true
steps:
- setup
- test
Expand Down
8 changes: 4 additions & 4 deletions core/lib/spree/testing_support/dummy_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -119,9 +119,9 @@ class Application < ::Rails::Application
Spree.config do |config|
config.mails_from = "[email protected]"

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

Expand Down
2 changes: 1 addition & 1 deletion core/lib/spree/testing_support/dummy_app/migrations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 09b74f8

Please sign in to comment.