Sha256: 22e5cf80676e4626e16b924ae720bad91aafd273316919148da50f165402a412

Contents?: true

Size: 532 Bytes

Versions: 1

Compression:

Stored size: 532 Bytes

Contents

json.cache! [product, current_store], expires_at: product.cache_expires_at do
  json.type 'products'
  json.id product.id

  json.attributes do
    json.partial! 'gemgento/api/v1/products/attributes', product: product
  end

  json.relationships do
    json.partial! 'gemgento/api/v1/products/relationships', product: product
  end

  if product.assets.where(store: current_store).any?
    json.included do
      json.array! product.assets.where(store: current_store), partial: 'gemgento/shared/asset', as: :asset
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gemgento-2.8.0 app/views/gemgento/api/v1/products/_product.json.jbuilder