Setup of product variants
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
class ProductSerializer < Qwaiter::Serializer
|
||||
root 'product'
|
||||
attributes :name, :price, :description, :image, :code, :position, :visible, :active, :product_category_id
|
||||
|
||||
has_many :product_variants
|
||||
|
||||
def image
|
||||
if object.image.present?
|
||||
{small: object.image.url(:small)}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
class ProductVariantSerializer < Qwaiter::Serializer
|
||||
root 'product_variant'
|
||||
attributes :name
|
||||
end
|
||||
Reference in New Issue
Block a user