diff --git a/app/controllers/concerns/facetable.rb b/app/controllers/concerns/facetable.rb index 3d7dad315..90f57485a 100644 --- a/app/controllers/concerns/facetable.rb +++ b/app/controllers/concerns/facetable.rb @@ -154,11 +154,11 @@ def facet_by_key(arr) end def facet_by_bool(arr) - values = { 0 => "no", 1 => "yes" } + id = hsh["key"] == 1 ? "true" : "false" arr.map do |hsh| { - "id" => hsh["key"], - "title" => values[hsh["key"]], + "id" => id, + "title" => id.capitalize, "count" => hsh["doc_count"], } end diff --git a/app/graphql/types/base_connection.rb b/app/graphql/types/base_connection.rb index 79e191231..abf377a20 100644 --- a/app/graphql/types/base_connection.rb +++ b/app/graphql/types/base_connection.rb @@ -90,11 +90,11 @@ def facet_by_key(arr) end def facet_by_bool(arr) - values = { 0 => "no", 1 => "yes" } + id = hsh["key"] == 1 ? "true" : "false" arr.map do |hsh| { - "id" => hsh["key"], - "title" => values[hsh["key"]], + "id" => id, + "title" => id.capitalize, "count" => hsh["doc_count"], } end