FIX - downcase strings consistently (#10861)

ruby and postgres can treat certain characters differently when downcasing them. So do all the downcasing in ruby so that we get consistent results.
This commit is contained in:
jbrw
2020-10-07 20:28:07 -04:00
committed by GitHub
parent bdbee36961
commit a1918801a4
2 changed files with 9 additions and 3 deletions

View File

@ -218,7 +218,7 @@ class TopicCreator
names = usernames.split(',').flatten.map(&:downcase)
len = 0
User.includes(:user_option).where('lower(username) in (?)', names).find_each do |user|
User.includes(:user_option).where('username_lower in (?)', names).find_each do |user|
check_can_send_permission!(topic, user)
@added_users << user
topic.topic_allowed_users.build(user_id: user.id)