From c24f0da520a17789a67a96f86bcac64804d307e6 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sun, 12 May 2019 00:17:48 +0200 Subject: [PATCH] correct count if state argument. #269 --- app/graphql/types/prefix_connection_with_total_count_type.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/graphql/types/prefix_connection_with_total_count_type.rb b/app/graphql/types/prefix_connection_with_total_count_type.rb index a044238c0..d242574b2 100644 --- a/app/graphql/types/prefix_connection_with_total_count_type.rb +++ b/app/graphql/types/prefix_connection_with_total_count_type.rb @@ -13,14 +13,14 @@ def total_count def states args = self.object.arguments - + if object.parent.class.name == "Provider" collection = object.parent.provider_prefixes.joins(:prefix) if args[:state].present? [{ id: args[:state], title: args[:state].underscore.humanize, - count: collection.count }] + count: collection.state(args[:state].underscore.dasherize).count }] else [{ id: "withoutClient", title: "Without client",