Change images in serializer to use product.images over variant.images

This commit is contained in:
Matt-Yorkley
2020-06-01 17:02:43 +02:00
parent 9c6dd1b324
commit 234f0f94cf

View File

@@ -32,8 +32,8 @@ class Api::VariantSerializer < ActiveModel::Serializer
end
def thumb_url
if object.images.present?
object.images.first.attachment.url(:mini)
if object.product.images.present?
object.product.images.first.attachment.url(:mini)
else
"/assets/noimage/mini.png"
end