Sha256: 4c272634265b51151dd2f93401186c72f400d5a3c1ae67d9ef03ac50255268ad

Contents?: true

Size: 583 Bytes

Versions: 10

Compression:

Stored size: 583 Bytes

Contents

# frozen_string_literal: true

module Spree::Image::ActiveStorageAttachment
  extend ActiveSupport::Concern
  include Spree::ActiveStorageAdapter

  delegate :width, :height, to: :attachment, prefix: true

  included do
    has_attachment :attachment,
                   styles: {
                   mini: '48x48>',
                   small: '400x400>',
                   product: '680x680>',
                   large: '1200x1200>'
                 },
                 default_style: :product
    validates :attachment, presence: true
    validate :attachment_is_an_image
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
solidus_core-2.11.8 app/models/spree/image/active_storage_attachment.rb
solidus_core-2.11.7 app/models/spree/image/active_storage_attachment.rb
solidus_core-2.11.6 app/models/spree/image/active_storage_attachment.rb
solidus_core-3.0.0.rc2 app/models/spree/image/active_storage_attachment.rb
solidus_core-2.11.5 app/models/spree/image/active_storage_attachment.rb
solidus_core-2.11.4 app/models/spree/image/active_storage_attachment.rb
solidus_core-2.11.3 app/models/spree/image/active_storage_attachment.rb
solidus_core-2.11.2 app/models/spree/image/active_storage_attachment.rb
solidus_core-2.11.1 app/models/spree/image/active_storage_attachment.rb
solidus_core-2.11.0 app/models/spree/image/active_storage_attachment.rb