Skip to content

Commit

Permalink
correct count if state argument. #269
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed May 11, 2019
1 parent afd1bff commit c24f0da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/graphql/types/prefix_connection_with_total_count_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c24f0da

Please sign in to comment.