Sha256: 84bfdf776654747d61b00e2a2441ecb456962be6178ef528349b5f2b030aa456
Contents?: true
Size: 813 Bytes
Versions: 18
Compression:
Stored size: 813 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 validates :attachment, presence: true validate :attachment_is_an_image validate :supported_content_type has_attachment :attachment, styles: { mini: '48x48>', small: '400x400>', product: '680x680>', large: '1200x1200>' }, default_style: :product def supported_content_type unless attachment.content_type.in?(Spree::Config.allowed_image_mime_types) errors.add(:attachment, :content_type_not_supported) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems