Sha256: 1b74e9b50591cbc833a91448d6a43b73533c9755d2938943a656cb2f2e410877

Contents?: true

Size: 521 Bytes

Versions: 3

Compression:

Stored size: 521 Bytes

Contents

module Spree
  module V2
    module Storefront
      class VariantSerializer < BaseSerializer
        set_type :variant

        attributes :sku, :price, :currency, :display_price, :weight, :height,
                   :width, :depth, :is_master, :options_text

        attribute :purchasable,   &:purchasable?
        attribute :in_stock,      &:in_stock?
        attribute :backorderable, &:backorderable?

        belongs_to :product
        has_many :images
        has_many :option_values
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_api-4.2.0.rc2 app/serializers/spree/v2/storefront/variant_serializer.rb
spree_api-4.2.0.rc1 app/serializers/spree/v2/storefront/variant_serializer.rb
spree_api-4.2.0.beta app/serializers/spree/v2/storefront/variant_serializer.rb