summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorBryce Johnson <bryce@gitlab.com>2016-10-07 11:35:23 +0200
committerBryce Johnson <bryce@gitlab.com>2016-10-15 08:28:53 +0200
commit349caec3088905cf4dc740b8809f9fd6fbdeeb0e (patch)
treef0abb991e36fb5ad8bd8278b432a19ce6131c4e5 /app
parentcdf232752a4c2bfc6ebb57bcca3b33bcf8755b40 (diff)
downloadgitlab-ce-349caec3088905cf4dc740b8809f9fd6fbdeeb0e.tar.gz
Stringify username before passing to ActiveRecord.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/users_controller.rb2
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