mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
22 lines
344 B
Ruby
22 lines
344 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.url(:mini)
|
|
end
|
|
|
|
def small_url
|
|
object.url(:small)
|
|
end
|
|
|
|
def image_url
|
|
object.url(:product)
|
|
end
|
|
|
|
def large_url
|
|
object.url(:large)
|
|
end
|
|
end
|