Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-30 17:17:03 +0300
committerDouwe Maan <douwe@gitlab.com>2015-04-30 17:17:03 +0300
commitd386bb780864f4fc36490e19ea654f31bf193d0f (patch)
tree48adcf65b79c5f1eaf11519007a776568cdd9b01 /app/models/email.rb
parent39a55bdf1a1613f362bcd7da444b291210454160 (diff)
Allow primary email to be set to an email that you've already added.
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