Sha256: ff20c6b8929ba9d34c7f0144d2a069b595c769ab0dbae21c6f4df7aab598f566
Contents?: true
Size: 823 Bytes
Versions: 69
Compression:
Stored size: 823 Bytes
Contents
module Spree class TaxonImage < Asset module Configuration module ActiveStorage extend ActiveSupport::Concern included do validate :check_attachment_content_type has_one_attached :attachment def self.styles @styles ||= { mini: '32x32>', normal: '128x128>' } end def default_style :mini end def accepted_image_types %w(image/jpeg image/jpg image/png image/gif) end def check_attachment_content_type if attachment.attached? && !attachment.content_type.in?(accepted_image_types) errors.add(:attachment, :not_allowed_content_type) end end end end end end end
Version data entries
69 entries across 69 versions & 1 rubygems