optimize autocomplete

This commit is contained in:
Pete Matsyburka committed 2024-02-27 15:24:28 +02:00
1 parent 801abd197b
commit 6ca44a5cc3
2 files changed
+7 -3

No files matched your search

@@ -24,9 +24,9 @@ module Api
if SELECT_COLUMNS.include?(params[:field])
column = Submitter.arel_table[params[:field].to_sym]
term = "%#{params[:q].downcase}%"
term = "#{params[:q].downcase}%"
submitters.where(column.lower.matches(term))
submitters.where(column.matches(term, false, true))
else
Submitters.search(submitters, params[:q])
end