diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-10-16 22:59:39 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-10-16 22:59:39 -0700 |
commit | dad831662ad6521dfaf404621b72e551d456ca5c (patch) | |
tree | a4f3e36675bfef1a2189b61e8b71bc293e7dd56b /app | |
parent | 9afc930b999048594e3f5a6a22097adcf2da50fe (diff) | |
parent | 12420a2256168a122b3a1f5a2c974df52fe802ec (diff) | |
download | gitlab-ce-dad831662ad6521dfaf404621b72e551d456ca5c.tar.gz |
Merge pull request #5350 from NARKOZ/patch-0
fix variable name
Diffstat (limited to 'app')
-rw-r--r-- | app/models/user.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 22292de40a6..df14cf34e85 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -199,11 +199,7 @@ class User < ActiveRecord::Base end def by_username_or_id(name_or_id) - if (name_or_id.is_a?(Integer)) - User.find_by_id(name_or_id) - else - User.find_by_username(name_or_id) - end + where('username = ? OR id = ?', name_or_id, name_or_id).first end def build_user(attrs = {}, options= {}) |