Class: Email
- Inherits:
-
MainClusterwide::ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- MainClusterwide::ApplicationRecord
- Defined in:
- app/models/email.rb
Constant Summary
Constants included from Gitlab::SQL::Pattern
Gitlab::SQL::Pattern::MIN_CHARS_FOR_PARTIAL_MATCHING, Gitlab::SQL::Pattern::REGEX_QUOTED_TERM
Constants inherited from ApplicationRecord
Constants included from ResetOnUnionError
ResetOnUnionError::MAX_RESET_PERIOD
Instance Method Summary collapse
- #email=(value) ⇒ Object
- #unique_email ⇒ Object
-
#update_invalid_gpg_signatures ⇒ Object
once email is confirmed, update the gpg signatures.
- #user_primary_email? ⇒ Boolean
Methods included from ForcedEmailConfirmation
Methods included from AfterCommitQueue
#run_after_commit, #run_after_commit_or_now
Methods included from Gitlab::SQL::Pattern
Methods inherited from ApplicationRecord
cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order
Methods included from SensitiveSerializableHash
Instance Method Details
#email=(value) ⇒ Object
28 29 30 |
# File 'app/models/email.rb', line 28 def email=(value) write_attribute(:email, value.downcase.strip) end |
#unique_email ⇒ Object
32 33 34 |
# File 'app/models/email.rb', line 32 def unique_email self.errors.add(:email, 'has already been taken') if primary_email_of_another_user? end |
#update_invalid_gpg_signatures ⇒ Object
once email is confirmed, update the gpg signatures
37 38 39 |
# File 'app/models/email.rb', line 37 def update_invalid_gpg_signatures user.update_invalid_gpg_signatures if confirmed? end |
#user_primary_email? ⇒ Boolean
41 42 43 |
# File 'app/models/email.rb', line 41 def user_primary_email? email.casecmp?(user.email) end |