End of evening commit, changing supplier to JSONAPI
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
class Suppliers::ProductSerializer
|
||||
include Qwaiter::SupplierBaseSerializer
|
||||
attributes :name, :price, :description, :code, :position, :visible, :active, :product_category_id
|
||||
attribute :image do
|
||||
if object.image.present?
|
||||
{small: object.image.url(:small)}
|
||||
else
|
||||
{small: object.image.url}
|
||||
end
|
||||
end
|
||||
|
||||
has_many :product_variants, serializer: Suppliers::ProductVariantSerializer
|
||||
end
|
||||
Reference in New Issue
Block a user