Sha256: 0c0aab994a888d59436b8e28c5b248fabe6128d4ffdd9b3350981150abeea6ea

Contents?: true

Size: 728 Bytes

Versions: 56

Compression:

Stored size: 728 Bytes

Contents

module Spree
  module V2
    module Storefront
      class UserSerializer < BaseSerializer
        set_type :user

        attributes :email

        attribute :store_credits, &:total_available_store_credit

        attribute :completed_orders do |object|
          object.orders.complete.count
        end

        has_one :default_billing_address,
          id_method_name: :bill_address_id,
          object_method_name: :bill_address,
          record_type: :address,
          serializer: :address

        has_one :default_shipping_address,
          id_method_name: :ship_address_id,
          object_method_name: :ship_address,
          record_type: :address,
          serializer: :address
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
spree_api-4.0.9 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.1.15 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.1.14 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.0.8 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-3.7.14.1 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.1.13.1 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.0.7.1 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.0.7 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-3.7.14 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.1.13 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.0.6 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.0.rc2 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-3.7.13 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.0.5 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.1.12 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-3.7.12 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.0.rc1 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.0.4 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-3.7.11 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.1.11 app/serializers/spree/v2/storefront/user_serializer.rb