Sha256: 84a0d18c9f0f484fb79f0ce9412f59394da8046954e4ec90c682c46ffa268b3e

Contents?: true

Size: 730 Bytes

Versions: 19

Compression:

Stored size: 730 Bytes

Contents

module Spree
  class TaxonImage < Asset
    module Configuration
      module ActiveStorage
        extend ActiveSupport::Concern

        included do
          if Spree.public_storage_service_name
            has_one_attached :attachment, service: Spree.public_storage_service_name
          else
            has_one_attached :attachment
          end

          validates :attachment, content_type: /\Aimage\/.*\z/

          default_scope { includes(attachment_attachment: :blob) }

          def self.styles
            @styles ||= {
              mini: '32x32>',
              normal: '128x128>'
            }
          end

          def default_style
            :mini
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
spree_core-4.8.3 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.8.2 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.7.3 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.6.6 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.5.5 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.5.4 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.6.5 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.7.2 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.7.1 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.6.4 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.7.0 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.6.3 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.6.2 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.6.1 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.6.0 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.5.3 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.5.2 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.5.1 app/models/spree/taxon_image/configuration/active_storage.rb
spree_core-4.5.0 app/models/spree/taxon_image/configuration/active_storage.rb