Doc how balance_value works

[skip ci]
This commit is contained in:
Pau Perez
2021-01-11 16:53:52 +01:00
parent 0b686bbd32
commit acd4dddf1b

View File

@@ -2,6 +2,10 @@
module Api
module Admin
# This serializer relies on `object` to respond to `#balance_value`. That's done in
# `CustomersWithBalance` due to the fact that ActiveRecord maps the DB result set's columns to
# instance methods. This way, the `balance_value` alias on that class ends up being
# `object.balance_value` here.
class CustomerWithBalanceSerializer < CustomerSerializer
attributes :balance, :balance_status