Sha256: f5cb3c37c6c2520696bdc94a814234f0eba033201b32675a163b9c2b8748dfa9

Contents?: true

Size: 587 Bytes

Versions: 9

Compression:

Stored size: 587 Bytes

Contents

# frozen_string_literal: true

module Spree::Taxon::PaperclipAttachment
  extend ActiveSupport::Concern

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

    validates_attachment :icon,
      content_type: { content_type: %w[image/jpg image/jpeg image/png image/gif] }
  end

  def icon_present?
    icon.present?
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
solidus_core-2.9.6 app/models/spree/taxon/paperclip_attachment.rb
solidus_core-2.9.5 app/models/spree/taxon/paperclip_attachment.rb
solidus_core-2.9.4 app/models/spree/taxon/paperclip_attachment.rb
solidus_core-2.9.3 app/models/spree/taxon/paperclip_attachment.rb
solidus_core-2.9.2 app/models/spree/taxon/paperclip_attachment.rb
solidus_core-2.10.0.beta1 app/models/spree/taxon/paperclip_attachment.rb
solidus_core-2.9.1 app/models/spree/taxon/paperclip_attachment.rb
solidus_core-2.9.0 app/models/spree/taxon/paperclip_attachment.rb
solidus_core-2.9.0.rc.1 app/models/spree/taxon/paperclip_attachment.rb