Skip to content

Commit

Permalink
Merge pull request #4565 from tvdeyen/v3.1-active-storage-rails-6.1
Browse files Browse the repository at this point in the history
[v3.1] Only default to activestorage adapter if Rails version is supported
  • Loading branch information
tvdeyen authored Sep 5, 2022
2 parents 2ce9c91 + fc8757c commit 566c931
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/lib/spree/app_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
require "spree/core/search/variant"
require 'spree/preferences/configuration'
require 'spree/core/environment'
require 'rails/gem_version'

module Spree
class AppConfiguration < Preferences::Configuration
Expand Down Expand Up @@ -481,7 +482,7 @@ def payment_canceller
# @!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::ActiveStorageAttachment'
class_name_attribute :image_attachment_module, default: Rails.gem_version >= Gem::Version.new("6.1.0") ? "Spree::Image::ActiveStorageAttachment" : "Spree::Image::PaperclipAttachment"

# @!attribute [rw] allowed_image_mime_types
#
Expand Down Expand Up @@ -539,7 +540,7 @@ def payment_canceller
# @!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::ActiveStorageAttachment'
class_name_attribute :taxon_attachment_module, default: Rails.gem_version >= Gem::Version.new("6.1.0") ? "Spree::Taxon::ActiveStorageAttachment" : "Spree::Taxon::PaperclipAttachment"

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

0 comments on commit 566c931

Please sign in to comment.