Sha256: c0ce62028b7153dfe3e5b985b864d41cc849535b9f20ebd5c995c76acbd299f8

Contents?: true

Size: 826 Bytes

Versions: 7

Compression:

Stored size: 826 Bytes

Contents

module Spree
  class TaxonIcon < Asset
    module Configuration
      module Paperclip
        extend ActiveSupport::Concern

        included do
          def self.styles
            attachment_definitions[:attachment][:styles]
          end

          delegate :url, to: :attachment

          has_attached_file :attachment,
            styles: { mini: '32x32>', normal: '128x128>' },
            default_style: :mini,
            url: '/spree/taxons/:viewable_id/:style/:basename.:extension',
            path: ':rails_root/public/spree/taxons/:viewable_id/:style/:basename.:extension',
            default_url: '/assets/default_taxon.png'

          validates_attachment :attachment,
            content_type: { content_type: ['image/jpg', 'image/jpeg', 'image/png', 'image/gif'] }
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spree_core-3.6.6 app/models/spree/taxon_icon/configuration/paperclip.rb
spree_core-3.6.5 app/models/spree/taxon_icon/configuration/paperclip.rb
spree_core-3.6.4 app/models/spree/taxon_icon/configuration/paperclip.rb
spree_core-3.6.3 app/models/spree/taxon_icon/configuration/paperclip.rb
spree_core-3.6.2 app/models/spree/taxon_icon/configuration/paperclip.rb
spree_core-3.6.1 app/models/spree/taxon_icon/configuration/paperclip.rb
spree_core-3.6.0 app/models/spree/taxon_icon/configuration/paperclip.rb