summaryrefslogtreecommitdiff
path: root/app/models/email.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-30 16:17:03 +0200
committerDouwe Maan <douwe@gitlab.com>2015-04-30 16:17:03 +0200
commitd386bb780864f4fc36490e19ea654f31bf193d0f (patch)
tree48adcf65b79c5f1eaf11519007a776568cdd9b01 /app/models/email.rb
parent39a55bdf1a1613f362bcd7da444b291210454160 (diff)
downloadgitlab-ce-d386bb780864f4fc36490e19ea654f31bf193d0f.tar.gz
Allow primary email to be set to an email that you've already added.change-primary-email
Diffstat (limited to 'app/models/email.rb')
-rw-r--r--app/models/email.rb5
1 files changed, 0 insertions, 5 deletions
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