From c59caed1bba10e6cada4c3fe13b14f45ff1a6329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Denquin?= Date: Wed, 27 Nov 2024 12:19:15 +0100 Subject: [PATCH] hotfix(taxes): Remove charges count from taxes serializer (#2877) - `count` on API serializer is causing a major performance issue --- app/serializers/v1/tax_serializer.rb | 3 ++- spec/serializers/v1/tax_serializer_spec.rb | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/serializers/v1/tax_serializer.rb b/app/serializers/v1/tax_serializer.rb index e0604858453..a1e86f6e47d 100644 --- a/app/serializers/v1/tax_serializer.rb +++ b/app/serializers/v1/tax_serializer.rb @@ -13,7 +13,8 @@ def serialize add_ons_count: model.add_ons.count, customers_count: model.customers_count, plans_count: model.plans.count, - charges_count: model.charges.count, + # DEPRECATED: this is creating a major performance issue + # charges_count: model.charges.count, commitments_count: model.commitments.count, created_at: model.created_at.iso8601 } diff --git a/spec/serializers/v1/tax_serializer_spec.rb b/spec/serializers/v1/tax_serializer_spec.rb index 9af144d1c75..73f1f959b47 100644 --- a/spec/serializers/v1/tax_serializer_spec.rb +++ b/spec/serializers/v1/tax_serializer_spec.rb @@ -19,7 +19,6 @@ 'add_ons_count' => 0, 'customers_count' => 0, 'plans_count' => 0, - 'charges_count' => 0, 'created_at' => tax.created_at.iso8601 ) end