Commit 4ac0c36f authored by Dan Jensen's avatar Dan Jensen

Remove presence validation on User#public_email

Since User#public_email was introduced in 2015, the validation rules
have included both allow_blank and presence (which means not-blank).
The allow_blank option takes precedence, so the presence option is
ignored. This removes the presence option so it does not cause
confusion or bugs in the future.
parent 21607dbf
......@@ -224,7 +224,7 @@ class User < ApplicationRecord
validates :email, confirmation: true
validates :notification_email, presence: true
validates :notification_email, devise_email: true, if: ->(user) { user.notification_email != user.email }
validates :public_email, presence: true, uniqueness: true, devise_email: true, allow_blank: true
validates :public_email, uniqueness: true, devise_email: true, allow_blank: true
validates :commit_email, devise_email: true, allow_nil: true, if: ->(user) { user.commit_email != user.email }
validates :projects_limit,
presence: true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment