FIX: created:@ search keyword for uppercase usernames (#22878)

The filter wasn't working if the username had uppercase letters.
This commit is contained in:
Canapin
2023-08-02 21:28:17 +02:00
committed by GitHub
parent 47593a9922
commit b3c722f2f7
2 changed files with 13 additions and 1 deletions

View File

@@ -491,7 +491,7 @@ class Search
end
advanced_filter(/\Acreated:@(.*)\z/i) do |posts, match|
user_id = User.where(username: match.downcase).pick(:id)
user_id = User.where(username_lower: match.downcase).pick(:id)
posts.where(user_id: user_id, post_number: 1)
end