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:
authorHeinrich Lee Yu <heinrich@gitlab.com>2019-06-25 20:54:42 +0300
committerHeinrich Lee Yu <heinrich@gitlab.com>2019-07-12 05:15:31 +0300
commitaeb67dd489b1ccc7f0ab1d702725729ab9cc3e27 (patch)
treec508ba9459274be6a8a0488a838d31f03f45faba /app/models/email.rb
parentecffca5d92353d55aaf8f984737fa617782310e0 (diff)
Upgrade to Rails 5.2
Updates changed method names and fixes spec failures
Diffstat (limited to 'app/models/email.rb')
-rw-r--r--app/models/email.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/email.rb b/app/models/email.rb
index 0ddaa049c3b..580633d3232 100644
--- a/app/models/email.rb
+++ b/app/models/email.rb
@@ -4,9 +4,8 @@ class Email < ApplicationRecord
include Sortable
include Gitlab::SQL::Pattern
- belongs_to :user
+ belongs_to :user, optional: false
- validates :user_id, presence: true
validates :email, presence: true, uniqueness: true, devise_email: true
validate :unique_email, if: ->(email) { email.email_changed? }