From d386bb780864f4fc36490e19ea654f31bf193d0f Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 30 Apr 2015 16:17:03 +0200 Subject: Allow primary email to be set to an email that you've already added. --- app/models/email.rb | 5 ----- 1 file changed, 5 deletions(-) (limited to 'app/models/email.rb') diff --git a/app/models/email.rb b/app/models/email.rb index 556b0e9586e..935705e2ed4 100644 --- a/app/models/email.rb +++ b/app/models/email.rb @@ -18,7 +18,6 @@ class Email < ActiveRecord::Base validates :email, presence: true, email: { strict_mode: true }, uniqueness: true validate :unique_email, if: ->(email) { email.email_changed? } - after_create :notify before_validation :cleanup_email def cleanup_email @@ -28,8 +27,4 @@ class Email < ActiveRecord::Base def unique_email self.errors.add(:email, 'has already been taken') if User.exists?(email: self.email) end - - def notify - NotificationService.new.new_email(self) - end end -- cgit v1.2.1