Sha256: bae4dc8c3b964dad0303615ccbb213e804a68d88212bfbcb8b4117b0afe513b8

Contents?: true

Size: 762 Bytes

Versions: 19

Compression:

Stored size: 762 Bytes

Contents

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

        attributes :email

        attribute :store_credits do |user|
          user.total_available_store_credit
        end

        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

19 entries across 19 versions & 1 rubygems

Version Path
spree_api-4.2.7 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.3.3 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.6 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.3.2 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.3.1 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.3.0 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.3.0.rc3 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.3.0.rc2 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.3.0.rc1 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.5 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.4 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.3.1 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.3 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.2 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.1 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.0 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.0.rc5 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.0.rc4 app/serializers/spree/v2/storefront/user_serializer.rb
spree_api-4.2.0.rc3 app/serializers/spree/v2/storefront/user_serializer.rb