Skip to content

Commit

Permalink
Use Hash#key instead of Hash#index
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Aug 6, 2017
1 parent 4ae91ae commit 6a6a3e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/blacklight/solr/response/spelling.rb
Expand Up @@ -73,8 +73,8 @@ def collation
return unless spellcheck && spellcheck[:suggestions]
suggestions = spellcheck[:suggestions]

if suggestions.index("collation")
suggestions[suggestions.index("collation") + 1]
if suggestions.key?("collation")
suggestions[suggestions.key("collation") + 1]
elsif spellcheck.key?("collations")
spellcheck['collations'].last
end
Expand Down

0 comments on commit 6a6a3e0

Please sign in to comment.