Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for improving user search. #3407

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.**
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading