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:
Diffstat (limited to 'app/models/issue_email_participant.rb')
-rw-r--r--app/models/issue_email_participant.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/issue_email_participant.rb b/app/models/issue_email_participant.rb
index 9d7e2afa1d9..bb03b3d72e6 100644
--- a/app/models/issue_email_participant.rb
+++ b/app/models/issue_email_participant.rb
@@ -3,6 +3,7 @@
class IssueEmailParticipant < ApplicationRecord
include BulkInsertSafe
include Presentable
+ include CaseSensitivity
belongs_to :issue
@@ -10,6 +11,8 @@ class IssueEmailParticipant < ApplicationRecord
validates :issue, presence: true
validate :validate_email_format
+ scope :with_emails, ->(emails) { iwhere(email: emails) }
+
def validate_email_format
self.errors.add(:email, I18n.t(:invalid, scope: 'valid_email.validations.email')) unless ValidateEmail.valid?(self.email)
end