Method: Spree::ActiveStorageAdapter::Attachment#variant

Defined in:
app/models/concerns/spree/active_storage_adapter/attachment.rb

#variant(style = nil) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'app/models/concerns/spree/active_storage_adapter/attachment.rb', line 31

def variant(style = nil)
  transformation = @transformations[style] || default_transformation(width, height)

  @attachment.variant({
    saver: {
      strip: true
    }
  }.merge(transformation)).processed
end