Class: Email
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Includes:
- AsyncDeviseEmail, Cells::Claimable, ForcedEmailConfirmation, Gitlab::SQL::Pattern, Sortable
- Defined in:
- app/models/email.rb
Constant Summary
Constants included from Cells::Claimable
Cells::Claimable::CLAIMS_BUCKET_TYPE, Cells::Claimable::CLAIMS_SOURCE_TYPE, Cells::Claimable::CLAIMS_SUBJECT_TYPE, Cells::Claimable::MissingPrimaryKeyError
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 HasCheckConstraints
HasCheckConstraints::NOT_NULL_CHECK_PATTERN
Constants included from ResetOnColumnErrors
ResetOnColumnErrors::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 Cells::Claimable
Methods included from Gitlab::SQL::Pattern
Methods inherited from ApplicationRecord
===, cached_column_list, #create_or_load_association, current_transaction, declarative_enum, default_select_columns, delete_all_returning, #deleted_from_database?, id_in, id_not_in, iid_in, nullable_column?, 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 Organizations::Sharding
Methods included from ResetOnColumnErrors
#reset_on_union_error, #reset_on_unknown_attribute_error
Methods included from Gitlab::SensitiveSerializableHash
Instance Method Details
#email=(value) ⇒ Object
43 44 45 |
# File 'app/models/email.rb', line 43 def email=(value) write_attribute(:email, value.downcase.strip) end |
#unique_email ⇒ Object
47 48 49 |
# File 'app/models/email.rb', line 47 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
52 53 54 |
# File 'app/models/email.rb', line 52 def update_invalid_gpg_signatures user.update_invalid_gpg_signatures if confirmed? end |
#user_primary_email? ⇒ Boolean
56 57 58 |
# File 'app/models/email.rb', line 56 def user_primary_email? email.casecmp?(user.email) end |