Module: SpreeCmCommissioner::ImageDecorator

Defined in:
app/models/spree_cm_commissioner/image_decorator.rb

Instance Method Summary collapse

Instance Method Details

#asset_stylesObject



17
18
19
# File 'app/models/spree_cm_commissioner/image_decorator.rb', line 17

def asset_styles
  self.class.styles.merge({ product_zoomed: '1200x1200>' })
end

#stylesObject

override



4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/models/spree_cm_commissioner/image_decorator.rb', line 4

def styles
  size = '1200x1200'
  width, height = size.split('x')

  [
    {
      url: cdn_image_url(attachment.variant(resize_to_limit: [width.to_i, height.to_i])),
      width: width,
      height: height
    }
  ]
end