Sha256: 70af3e01ac8c1ef27793732156fe78ec022ce9d190a0b3c4ebbe082bc1413c7b

Contents?: true

Size: 608 Bytes

Versions: 29

Compression:

Stored size: 608 Bytes

Contents

module Spree
  module Api
    module V2
      module Platform
        class PromotionActionSerializer < BaseSerializer
          include ResourceSerializerConcern

          belongs_to :promotion

          # Some promotion actions have a :calculator, while others do not.
          has_one :calculator, if: proc { |record| record.respond_to?(:calculator) }

          # Only the CreateLineItems promotion action uses :promotion_action_line_items.
          has_many :promotion_action_line_items, if: proc { |record| record.respond_to?(:promotion_action_line_items) }
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
spree_api-4.10.1 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.10.0 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.9.0 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.8.3 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.8.2 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.7.3 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.6.6 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.5.5 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.4.1 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.5.4 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.6.5 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.7.2 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.7.1 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.6.4 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.7.0 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.6.3 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.6.2 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.6.1 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.6.0 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
spree_api-4.5.3 app/serializers/spree/api/v2/platform/promotion_action_serializer.rb