Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Johnson <bryce@gitlab.com>2016-10-07 12:35:23 +0300
committerBryce Johnson <bryce@gitlab.com>2016-10-15 09:28:53 +0300
commit349caec3088905cf4dc740b8809f9fd6fbdeeb0e (patch)
treef0abb991e36fb5ad8bd8278b432a19ce6131c4e5 /app/controllers/users_controller.rb
parentcdf232752a4c2bfc6ebb57bcca3b33bcf8755b40 (diff)
Stringify username before passing to ActiveRecord.
Diffstat (limited to 'app/controllers/users_controller.rb')
-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