Sha256: 4210b12d417ffa89c8b7dc9bc371c5697576ba4d6c613b247ad3931c4237618c

Contents?: true

Size: 424 Bytes

Versions: 52

Compression:

Stored size: 424 Bytes

Contents

module Spree
  class TaxonImage < Asset
    include Configuration::ActiveStorage
    include Rails.application.routes.url_helpers

    def styles
      self.class.styles.map do |_, size|
        width, height = size[/(\d+)x(\d+)/].split('x')

        {
          url: polymorphic_path(attachment.variant(resize: size), only_path: true),
          width: width,
          height: height
        }
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
spree_core-4.0.9 app/models/spree/taxon_image.rb
spree_core-4.1.15 app/models/spree/taxon_image.rb
spree_core-4.2.7 app/models/spree/taxon_image.rb
spree_core-4.2.6 app/models/spree/taxon_image.rb
spree_core-4.3.0.rc2 app/models/spree/taxon_image.rb
spree_core-4.3.0.rc1 app/models/spree/taxon_image.rb
spree_core-4.2.5 app/models/spree/taxon_image.rb
spree_core-4.1.14 app/models/spree/taxon_image.rb
spree_core-4.0.8 app/models/spree/taxon_image.rb
spree_core-4.2.4 app/models/spree/taxon_image.rb
spree_core-4.2.3.1 app/models/spree/taxon_image.rb
spree_core-4.1.13.1 app/models/spree/taxon_image.rb
spree_core-4.0.7.1 app/models/spree/taxon_image.rb
spree_core-4.2.3 app/models/spree/taxon_image.rb
spree_core-4.2.2 app/models/spree/taxon_image.rb
spree_core-4.2.1 app/models/spree/taxon_image.rb
spree_core-4.0.7 app/models/spree/taxon_image.rb
spree_core-4.2.0 app/models/spree/taxon_image.rb
spree_core-4.2.0.rc5 app/models/spree/taxon_image.rb
spree_core-4.2.0.rc4 app/models/spree/taxon_image.rb