Files
openfoodnetwork/app/serializers/api/image_serializer.rb
Luis Ramos e52937c113 Use rubocop auto correct to add frozen string literal to all files
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00

22 lines
416 B
Ruby

# frozen_string_literal: true
class Api::ImageSerializer < ActiveModel::Serializer
attributes :id, :alt, :thumb_url, :small_url, :image_url, :large_url
def thumb_url
object.attachment.url(:mini, false)
end
def small_url
object.attachment.url(:small, false)
end
def image_url
object.attachment.url(:product, false)
end
def large_url
object.attachment.url(:large, false)
end
end