Skip to content

Commit

Permalink
Merge pull request #3970 from nebulab/kennyadsl/improve-activestorage…
Browse files Browse the repository at this point in the history
…-config-dummy

Improve Active Storage configuration for in-memory Dummy App
  • Loading branch information
kennyadsl authored Mar 8, 2021
2 parents fd9ad4c + d9c740b commit a7d6755
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 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 = "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

Expand Down
3 changes: 0 additions & 3 deletions core/lib/spree/testing_support/dummy_app/migrations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ def auto_migrate
ActiveRecord::Base.remove_connection

sh 'rake db:reset VERBOSE=false'
if ENV['ENABLE_ACTIVE_STORAGE']
sh 'rake active_storage:install db:migrate VERBOSE=false'
end

# We have a brand new database, so we must re-establish our connection
ActiveRecord::Base.establish_connection
Expand Down

0 comments on commit a7d6755

Please sign in to comment.