diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-01-05 14:47:35 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-01-05 14:47:35 +0000 |
commit | f01dc248772e81e11ed60630410564d568858583 (patch) | |
tree | f615f1fbaaa023a3250c875cfabb32526d3181d1 /app | |
parent | d7856a4b74d64a8702ef4668db3e545da1e9c0c0 (diff) | |
download | redmine-f01dc248772e81e11ed60630410564d568858583.tar.gz redmine-f01dc248772e81e11ed60630410564d568858583.zip |
Rails3: replace deprecated Errors#on to Errors#[] at app/models/mail_handler.rb
On Rails2, Errors#[] returns single error if one error raises.
But, on Rails3, Errors#[] always returns the array.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8520 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/mail_handler.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 221b7885e..4ded2acb0 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -346,9 +346,9 @@ class MailHandler < ActionMailer::Base user.language = Setting.default_language unless user.valid? - user.login = "user#{ActiveSupport::SecureRandom.hex(6)}" if user.errors.on(:login) - user.firstname = "-" if user.errors.on(:firstname) - user.lastname = "-" if user.errors.on(:lastname) + user.login = "user#{ActiveSupport::SecureRandom.hex(6)}" unless user.errors[:login].blank? + user.firstname = "-" unless user.errors[:firstname].blank? + user.lastname = "-" unless user.errors[:lastname].blank? end user |