give some love to the waiter app

This commit is contained in:
2016-06-02 16:38:09 +02:00
parent e4461d3d29
commit ca8cc80b22
19 changed files with 124 additions and 26 deletions
@@ -0,0 +1,14 @@
class Waiter::ProductSerializer
include Qwaiter::WaiterBaseSerializer
attributes :name, :price, :description, :code, :position, :visible, :active
attribute :image do
if object.image.present?
{small: object.image.url(:small)}
else
{small: object.image.url}
end
end
has_many :product_variants, serializer: Waiter::ProductVariantSerializer
has_one :product_category, serializer: Waiter::ProductCategorySerializer
end