From f01dc248772e81e11ed60630410564d568858583 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 5 Jan 2012 14:47:35 +0000 Subject: 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 --- app/models/mail_handler.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') 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 -- cgit v1.2.3