mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
20 lines
385 B
Ruby
20 lines
385 B
Ruby
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
|