Downcase username on db end

There was a bug where users with capital letters in their name could not access their profiles after we tried to make things case insensitive.
This commit is contained in:
Justin Edmund 2023-07-04 03:18:59 -07:00
parent 197aad8a8d
commit 3ff89796d4

View file

@ -167,11 +167,11 @@ module Api
# Specify whitelisted properties that can be modified. # Specify whitelisted properties that can be modified.
def set def set
@user = User.where('username = ?', params[:id].downcase).first @user = User.find_by('lower(username) = ?', params[:id].downcase)
end end
def set_by_id def set_by_id
@user = User.where('id = ?', params[:id]).first @user = User.find_by('id = ?', params[:id])
end end
def user_params def user_params