From aeb67dd489b1ccc7f0ab1d702725729ab9cc3e27 Mon Sep 17 00:00:00 2001 From: Heinrich Lee Yu Date: Wed, 26 Jun 2019 01:54:42 +0800 Subject: Upgrade to Rails 5.2 Updates changed method names and fixes spec failures --- app/models/email.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/models/email.rb') 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? } -- cgit v1.2.1