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:
parent
197aad8a8d
commit
3ff89796d4
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue