From 836a60a6c78e797177bf3fbd9996a236cb129fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Turbelin?= Date: Sun, 23 Jan 2022 15:30:19 +0100 Subject: [PATCH] Add missing full_name bind to subscriptions serializer --- app/serializers/api/admin/subscription_serializer.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/serializers/api/admin/subscription_serializer.rb b/app/serializers/api/admin/subscription_serializer.rb index 4fab4ef769..cdaecf432e 100644 --- a/app/serializers/api/admin/subscription_serializer.rb +++ b/app/serializers/api/admin/subscription_serializer.rb @@ -4,9 +4,9 @@ module Api module Admin class SubscriptionSerializer < ActiveModel::Serializer attributes :id, :shop_id, :customer_id, :schedule_id, :payment_method_id, :shipping_method_id, - :begins_at, :ends_at, - :customer_email, :customer_first_name, :customer_last_name, :schedule_name, :edit_path, :canceled_at, - :paused_at, :state, :shipping_fee_estimate, :payment_fee_estimate + :begins_at, :ends_at, :customer_email, :customer_first_name, :customer_last_name, + :customer_full_name, :schedule_name, :edit_path, :canceled_at, :paused_at, :state, + :shipping_fee_estimate, :payment_fee_estimate has_many :subscription_line_items, serializer: Api::Admin::SubscriptionLineItemSerializer has_many :closed_proxy_orders, serializer: Api::Admin::ProxyOrderSerializer @@ -42,6 +42,10 @@ module Api object.customer&.last_name end + def customer_full_name + object.customer&.full_name + end + def schedule_name object.schedule&.name end