Sha256: 6ba427a77c78e6d0080e628595d0ce6326736e01820c166d6cfeb87366741d8c

Contents?: true

Size: 793 Bytes

Versions: 5

Compression:

Stored size: 793 Bytes

Contents

object false
node(:count) { @variants.count }
node(:total_count) { @variants.total_count }
node(:current_page) { params[:page] ? params[:page].to_i : 1 }
node(:pages) { @variants.num_pages }

child(@variants => :variants) do
  attributes *variant_attributes
  child(:option_values => :option_values) { attributes *option_value_attributes }
  child(:images => :images) do
    attributes *image_attributes
    code(:urls) do |v|
      v.attachment.styles.keys.inject({}) { |urls, style| urls[style] = v.attachment.url(style); urls  }
    end
  end

  child(:stock_items => :stock_items) do
    attributes :id, :count_on_hand, :stock_location_id, :backorderable
    attribute :available? => :available

    glue(:stock_location) do
      attribute :name => :stock_location_name
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree_api-2.0.13 app/views/spree/api/variants/index.v1.rabl
spree_api-2.0.12 app/views/spree/api/variants/index.v1.rabl
spree_api-2.0.11 app/views/spree/api/variants/index.v1.rabl
spree_api-2.0.10 app/views/spree/api/variants/index.v1.rabl
spree_api-2.0.9 app/views/spree/api/variants/index.v1.rabl