13 lines
292 B
Ruby
13 lines
292 B
Ruby
class ProductSerializer < Qwaiter::Serializer
|
|
embed :ids, include: true
|
|
attributes :name, :price, :description, :image, :code, :position, :visible, :product_category_id
|
|
|
|
def image
|
|
if object.image.present?
|
|
{small: object.image.url(:small)}
|
|
else
|
|
nil
|
|
end
|
|
end
|
|
end
|