Sha256: 373450efa6c08a0bddfeed8adec9ad6f389d0cd9a3ea95ae834286bbbf5d10f0

Contents?: true

Size: 632 Bytes

Versions: 2

Compression:

Stored size: 632 Bytes

Contents

# frozen_string_literal: true

json.cache! [I18n.locale, Spree::StockLocation.accessible_by(current_ability), variant] do
  json.(variant, *variant_attributes)
  json.partial!("spree/api/variants/small", variant:)
  json.variant_properties(variant.variant_properties) do |variant_property|
    json.(variant_property, *variant_property_attributes)
  end
  json.stock_items(variant.stock_items.accessible_by(current_ability)) do |stock_item|
    json.(stock_item, :id, :count_on_hand, :stock_location_id, :backorderable)
    json.available stock_item.available?
    json.stock_location_name(stock_item.stock_location.name)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_api-4.4.1 app/views/spree/api/variants/_big.json.jbuilder
solidus_api-4.4.0 app/views/spree/api/variants/_big.json.jbuilder