remove unneeded Relation#all from Principal model

git-svn-id: http://svn.redmine.org/redmine/trunk@12731 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-01-27 02:19:03 +00:00
parent 8832cca13b
commit ea8febad03
1 changed files with 1 additions and 1 deletions

View File

@ -387,7 +387,7 @@ class User < Principal
if login.present?
login = login.to_s
# First look for an exact match
user = where(:login => login).all.detect {|u| u.login == login}
user = where(:login => login).detect {|u| u.login == login}
unless user
# Fail over to case-insensitive if none was found
user = where("LOWER(login) = ?", login.downcase).first