Sha256: 2a57107aab5472dfdcf00eefad9d81c5d76339bcdc2e22a85bd027ccb195b93f
Contents?: true
Size: 561 Bytes
Versions: 9
Compression:
Stored size: 561 Bytes
Contents
module Spree module ImageMethods extend ActiveSupport::Concern def generate_url(size:, gravity: 'center', quality: 80, background: 'show') return if size.blank? size = size.gsub(/\s+/, '') return unless size.match(/(\d+)x(\d+)/) polymorphic_path(attachment.variant( gravity: gravity, resize: size, extent: size, background: background, quality: quality.to_i ), only_path: true) end def original_url polymorphic_path(attachment, only_path: true) end end end
Version data entries
9 entries across 9 versions & 1 rubygems