Sha256: 87b68e4c074538c3a6ab3eb70d252458c2881d33cd2f581b992fdba084bebccb
Contents?: true
Size: 425 Bytes
Versions: 16
Compression:
Stored size: 425 Bytes
Contents
module Paperclip class Attachment extend ActiveSupport::Memoizable def to_liquid {}.tap do |h| all_styles = self.styles.keys + ['original'] all_styles.each do |style| g = Paperclip::Geometry.from_file(self.path(style)) h[style] = {'width' => g.width.to_i, 'height' => g.height.to_i, 'url' => self.url(style)} end end end memoize :to_liquid end end
Version data entries
16 entries across 16 versions & 1 rubygems