From 5034abbbf3048fe63b8d343b58dd10998b3f2865 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Fri, 15 Mar 2013 23:43:55 +0000 Subject: [PATCH] Adding email to login label --- app/models/user.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index db66b1b..6ddd9ee 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -15,7 +15,7 @@ class User < ActiveRecord::Base # FIXME ugly workaround def self.human_attribute_name(attrib) case attrib.to_sym - when :login: return _('Username') + when :login: return [_('Username'), _('Email')].join(' / ') when :email: return _('e-Mail') else _(self.superclass.human_attribute_name(attrib)) end @@ -116,7 +116,7 @@ class User < ActiveRecord::Base validates_inclusion_of :terms_accepted, :in => [ '1' ], :if => lambda { |u| ! u.terms_of_use.blank? }, :message => N_('%{fn} must be checked in order to signup.').fix_i18n - # Authenticates a user by their login name and unencrypted password. Returns the user or nil. + # Authenticates a user by their login name or email and unencrypted password. Returns the user or nil. def self.authenticate(login, password, environment = nil) environment ||= Environment.default u = self.first :conditions => ['(login = ? OR email = ?) AND environment_id = ? AND activated_at IS NOT NULL', -- libgit2 0.21.2