diff options
author | Bryce Johnson <bryce@gitlab.com> | 2016-10-07 11:35:23 +0200 |
---|---|---|
committer | Bryce Johnson <bryce@gitlab.com> | 2016-10-15 08:28:53 +0200 |
commit | 349caec3088905cf4dc740b8809f9fd6fbdeeb0e (patch) | |
tree | f0abb991e36fb5ad8bd8278b432a19ce6131c4e5 /app/controllers | |
parent | cdf232752a4c2bfc6ebb57bcca3b33bcf8755b40 (diff) | |
download | gitlab-ce-349caec3088905cf4dc740b8809f9fd6fbdeeb0e.tar.gz |
Stringify username before passing to ActiveRecord.
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/users_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 30f0118254a..7a2bd83f22f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -86,7 +86,7 @@ class UsersController < ApplicationController end def exists - render json: { exists: !User.find_by_username(params[:username]).nil? } + render json: { exists: User.where(username: params[:username].to_s).any? } end private |