diff options
author | Bryce Johnson <bryce@gitlab.com> | 2016-10-07 12:35:23 +0300 |
---|---|---|
committer | Bryce Johnson <bryce@gitlab.com> | 2016-10-15 09:28:53 +0300 |
commit | 349caec3088905cf4dc740b8809f9fd6fbdeeb0e (patch) | |
tree | f0abb991e36fb5ad8bd8278b432a19ce6131c4e5 /app/controllers/users_controller.rb | |
parent | cdf232752a4c2bfc6ebb57bcca3b33bcf8755b40 (diff) |
Stringify username before passing to ActiveRecord.
Diffstat (limited to 'app/controllers/users_controller.rb')
-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 |