make authentication methods more readable (thanks @fsmanuel)

This commit is contained in:
wvengen 2013-11-11 16:23:20 +01:00
parent f7a0103553
commit ce3b89c910

View file

@ -149,8 +149,8 @@ class User < ActiveRecord::Base
self.groups.find(:all, :conditions => {:type => ""})
end
def self.authenticate(nick, password)
user = (find_by_nick(nick) or find_by_email(nick))
def self.authenticate(login, password)
user = (find_by_nick(login) or find_by_email(login))
if user && user.has_password(password)
user
else