Module: Spree::V2::Storefront::CartSerializerDecorator

Defined in:
app/serializers/spree/v2/storefront/cart_serializer_decorator.rb

Class Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/serializers/spree/v2/storefront/cart_serializer_decorator.rb', line 5

def self.prepended(base)
  base.attributes :phone_number, :intel_phone_number, :country_code, :request_state,
                  :channel

  base.attribute :qr_data do |order|
    order.qr_data if order.completed?
  end

  # override to return all payments instead of only valid_payments
  base.has_many :payments
  base.has_many :saved_guests, serializer: ::SpreeCmCommissioner::V2::Storefront::SavedGuestSerializer
end