summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorGabriel Mazetto <gabriel@gitlab.com>2015-12-15 00:53:52 -0200
committerGabriel Mazetto <gabriel@gitlab.com>2015-12-15 00:53:52 -0200
commitb5291f95996743067bbec5a32f9c6cf0d34b36c7 (patch)
tree9933fe5c9c224a175fb49fceff829b8b4441c970 /app/models/user.rb
parentd1f1c5c60bfd58f966671d7895c1ef612e8f8897 (diff)
downloadgitlab-ce-b5291f95996743067bbec5a32f9c6cf0d34b36c7.tar.gz
Fixed Rubocop offenses
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index fdd14f4571d..e0ce091c54e 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -220,9 +220,9 @@ class User < ActiveRecord::Base
def find_for_database_authentication(warden_conditions)
conditions = warden_conditions.dup
if login = conditions.delete(:login)
- where(conditions).where(["lower(username) = :value OR lower(email) = :value", { value: login.downcase }]).first
+ where(conditions).find_by("lower(username) = :value OR lower(email) = :value", value: login.downcase)
else
- where(conditions).first
+ find_by(conditions)
end
end
@@ -285,7 +285,7 @@ class User < ActiveRecord::Base
end
def by_username_or_id(name_or_id)
- where('users.username = ? OR users.id = ?', name_or_id.to_s, name_or_id.to_i).first
+ find_by('users.username = ? OR users.id = ?', name_or_id.to_s, name_or_id.to_i)
end
def build_user(attrs = {})