Skip to content

Commit 938a542

Browse files
committed
#598: fix autocomplete query
1 parent 874f651 commit 938a542

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

app/models/country.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def to_label
2222
def self.search_name(country: nil, substring: false)
2323
country = "%#{country}%" if country.present? && substring
2424
Country.where(
25-
"name COLLATE LIKE :country
25+
"name LIKE :country
2626
", {country: country}
2727
)
2828
end

app/models/institution.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def to_label
2121
def self.search_name(institution: nil, substring: false)
2222
institution = "%#{institution}%" if institution.present? && substring
2323
Institution.where(
24-
"name COLLATE LIKE :institution
25-
OR code COLLATE LIKE :institution
24+
"name LIKE :institution
25+
OR code LIKE :institution
2626
", {institution: institution}
2727
)
2828
end

0 commit comments

Comments
 (0)