Add image to product
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
class ProductSerializer < Qwaiter::Serializer
|
||||
embed :ids, include: true
|
||||
attributes :name, :price, :description
|
||||
attributes :name, :price, :description, :image
|
||||
|
||||
def image
|
||||
if object.image.present?
|
||||
{small: object.image.url(:small)}
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user