Skip to content

Commit

Permalink
Fix hash deprecation warnings in spelling; fixes #1666
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Aug 9, 2017
1 parent 458f8e3 commit dd80ccd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/blacklight/solr/response/spelling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ def collation
return unless spellcheck && spellcheck[:suggestions]
suggestions = spellcheck[:suggestions]

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

0 comments on commit dd80ccd

Please sign in to comment.