Skip to content

Commit

Permalink
Safety 3rd
Browse files Browse the repository at this point in the history
  • Loading branch information
cavis committed Aug 28, 2019
1 parent 6d430bc commit 94d7034
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hal_api/controller/filtering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def index_collection
# add facets if defined, removing filters/facets with counts of 0
non_zero_facets = (filter_facets || {}).with_indifferent_access.tap do |hash|
hash.each do |filter_key, facets|
hash[filter_key] = facets.select { |f| f.try(:[], :count) > 0 }
hash[filter_key] = facets.try(:select) { |f| f.try(:[], :count) > 0 }
hash.delete(filter_key) if hash[filter_key].blank?
end
end
Expand Down

0 comments on commit 94d7034

Please sign in to comment.