diff --git a/CHANGELOG.md b/CHANGELOG.md index 3aeeb4e2f3..971a69f417 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 4.2.1 + +### Changed +- A minor change to search that removes extra empty sppaces between words to allow user search to work if there are more than one space between firstname and surname, e,g., "Jill Blogss" and "Jill Bloggs" should return same results. + ## v4.2.0 **Note this upgrade is mainly a migration from Bootstrap 3 to Bootstrap 5.** diff --git a/app/models/user.rb b/app/models/user.rb index c3ff357961..e8afb3f93e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -138,7 +138,7 @@ class User < ApplicationRecord if date_range?(term: term) by_date_range(:created_at, term) else - search_pattern = "%#{term}%" + search_pattern = "%#{term}%".squish! # MySQL does not support standard string concatenation and since concat_ws # or concat functions do not exist for sqlite, we have to come up with this # conditional