aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenare Degan <henare.degan@gmail.com>2013-02-07 18:36:08 +1100
committerHenare Degan <henare.degan@gmail.com>2013-02-07 18:36:08 +1100
commit530d27099add131a81295f1cbed66568c806edc4 (patch)
tree21e047c888652b1c06ca857cd745a2616bd87983
parenta80a9bd62b6f7fc6f4dec99f7f101b7cecfb9285 (diff)
#errors always returns an array now so check for an empty one instead
-rw-r--r--app/models/change_email_validator.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/change_email_validator.rb b/app/models/change_email_validator.rb
index 9ef25217d..5e954e624 100644
--- a/app/models/change_email_validator.rb
+++ b/app/models/change_email_validator.rb
@@ -38,11 +38,11 @@ class ChangeEmailValidator < ActiveRecord::BaseWithoutTable
errors.add(:old_email, _("Old email doesn't look like a valid address"))
end
- if !errors[:old_email]
+ if errors[:old_email].blank?
if self.old_email.downcase != self.logged_in_user.email.downcase
errors.add(:old_email, _("Old email address isn't the same as the address of the account you are logged in with"))
elsif (!self.changing_email) && (!self.logged_in_user.has_this_password?(self.password))
- if !errors[:password]
+ if errors[:password].blank?
errors.add(:password, _("Password is not correct"))
end
end