Sha256: b7775db1446690355eecf109e54d40d9d990de8149b344984acfb6a93b966fc5
Contents?: true
Size: 805 Bytes
Versions: 9
Compression:
Stored size: 805 Bytes
Contents
module Spree module V2 module Storefront class UserSerializer < BaseSerializer set_type :user attributes :email, :first_name, :last_name, :public_metadata 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
9 entries across 9 versions & 3 rubygems