Skip to content

Commit

Permalink
Merge pull request #3969 from nebulab/kennyadsl/add-activestorage-dum…
Browse files Browse the repository at this point in the history
…my-extensions

Add Active Storage in Dummy App for extensions
  • Loading branch information
kennyadsl authored Mar 8, 2021
2 parents a7d6755 + db7ff8d commit 26d6596
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions core/lib/generators/spree/dummy/dummy_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def test_dummy_config
@database = options[:database]

template "rails/database.yml", "#{dummy_path}/config/database.yml", force: true
template "rails/storage.yml", "#{dummy_path}/config/storage/test.yml", force: true
template "rails/boot.rb", "#{dummy_path}/config/boot.rb", force: true
template "rails/application.rb.tt", "#{dummy_path}/config/application.rb", force: true
template "rails/routes.rb", "#{dummy_path}/config/routes.rb", force: true
Expand Down
3 changes: 3 additions & 0 deletions core/lib/generators/spree/dummy/templates/rails/storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test:
service: Disk
root: <%= File.expand_path("#{dummy_path}/tmp/storage", destination_root) %>
2 changes: 2 additions & 0 deletions core/lib/generators/spree/dummy/templates/rails/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
config.action_mailer.delivery_method = :test
ActionMailer::Base.default from: "solidus@example.com"

config.active_storage.service = :test

# Raise on deprecation warnings
if ENV['SOLIDUS_RAISE_DEPRECATIONS'].present?
Spree::Deprecation.behavior = :raise
Expand Down
12 changes: 6 additions & 6 deletions core/lib/spree/app_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -437,23 +437,23 @@ def payment_canceller

# Allows switching attachment library for Image
#
# `Spree::Image::PaperclipAttachment`
# is the default and provides the classic Paperclip implementation.
# `Spree::Image::ActiveStorageAttachment`
# is the default and provides the Active Storage implementation.
#
# @!attribute [rw] image_attachment_module
# @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::PaperclipAttachment'
class_name_attribute :image_attachment_module, default: 'Spree::Image::ActiveStorageAttachment'

# Allows switching attachment library for Taxon
#
# `Spree::Taxon::PaperclipAttachment`
# is the default and provides the classic Paperclip implementation.
# `Spree::Taxon::ActiveStorageAttachment`
# is the default and provides the Active Storage implementation.
#
# @!attribute [rw] taxon_attachment_module
# @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::PaperclipAttachment'
class_name_attribute :taxon_attachment_module, default: 'Spree::Taxon::ActiveStorageAttachment'

# Allows providing your own class instance for generating order numbers.
#
Expand Down

0 comments on commit 26d6596

Please sign in to comment.