JSONApi progress
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
class Users::ProductSerializer < Qwaiter::UserBaseSerializer
|
||||
attributes :name, :price, :description, :image, :code, :position, :visible, :active, :product_category_id
|
||||
|
||||
has_many :product_variants, serializer: Users::ProductVariantSerializer
|
||||
|
||||
def image
|
||||
if object.image.present?
|
||||
{small: object.image.url(:small)}
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user