Skip to content

Commit d167cce

Browse files
AlanMcCannDavid Padilla
authored and
David Padilla
committed
downcase the query string so it matches no matter the mix of case
1 parent ac79c37 commit d167cce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/autocomplete.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def autocomplete(object, method, options = {})
3232

3333
define_method("autocomplete_#{object}_#{method}") do
3434
unless params[:term] && params[:term].empty?
35-
items = object.to_s.camelize.constantize.where(["LOWER(#{method}) LIKE ?", "%#{params[:term]}%"]).limit(limit).order(order)
35+
items = object.to_s.camelize.constantize.where(["LOWER(#{method}) LIKE ?", "%#{params[:term].downcase}%"]).limit(limit).order(order)
3636
else
3737
items = {}
3838
end

0 commit comments

Comments
 (0)