Class: UserDetail

Inherits:
ApplicationRecord show all
Extended by:
Gitlab::Utils::Override
Includes:
Sanitizable
Defined in:
app/models/user_detail.rb

Constant Summary collapse

DEFAULT_FIELD_LENGTH =
500
BLUESKY_VALIDATION_REGEX =

specification for bluesky identifier web.plc.directory/spec/v0.1/did-plc

/
  \A            # beginning of string
  did:plc:      # beginning of bluesky id
  [a-z0-9]{24}  # 24 characters of word or digit
  \z            # end of string
/x
MASTODON_VALIDATION_REGEX =
/
  \A            # beginning of string
  @?\b          # optional leading at
  ([\w\d.%+-]+) # character group to pick up words in user portion of username
  @             # separator between user and host
  (             # beginning of character group for host portion
    [\w\d.-]+   # character group to pick up words in host portion of username
    \.\w{2,}    # pick up tld of host domain, 2 chars or more
  )\b           # end of character group to pick up words in host portion of username
  \z            # end of string
/x
ORCID_VALIDATION_REGEX =
/
  \A            # beginning of string
  (             #
    [0-9]{4}-   # 4 digits spaced by dash
  ){3}          # 3 times
  (             #
  [0-9]{3}      # end with 3 digits
  )             #
  [0-9X]        # followed by a fourth digit or an X
  \z            # end of string
/x

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Constants included from HasCheckConstraints

HasCheckConstraints::NOT_NULL_CHECK_PATTERN

Constants included from ResetOnColumnErrors

ResetOnColumnErrors::MAX_RESET_PERIOD

Instance Method Summary collapse

Methods included from Gitlab::Utils::Override

extended, extensions, included, method_added, override, prepended, queue_verification, verify!

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

#sharding_organization

Methods included from ResetOnColumnErrors

#reset_on_union_error, #reset_on_unknown_attribute_error

Instance Method Details

#serializable_hash(options = nil) ⇒ Object

Exclude the hashed email_otp attribute



88
89
90
91
92
93
94
# File 'app/models/user_detail.rb', line 88

def serializable_hash(options = nil)
  options = options.try(:dup) || {}
  options[:except] = Array(options[:except]).dup
  options[:except].concat [:email_otp]

  super
end