Sha256: 0aca8b1b8f049feba07853583d947f2a97896a471693a0ad34d3cfd7ef85a004

Contents?: true

Size: 636 Bytes

Versions: 2

Compression:

Stored size: 636 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 do |variant|
          variant.purchasable?
        end

        attribute :in_stock do |variant|
          variant.in_stock?
        end

        attribute :backorderable do |variant|
          variant.backorderable?
        end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_api-4.2.0.rc4 app/serializers/spree/v2/storefront/variant_serializer.rb
spree_api-4.2.0.rc3 app/serializers/spree/v2/storefront/variant_serializer.rb