Class: ServiceDesk::CustomEmailVerification
Constant Summary
collapse
- TIMEFRAME =
30.minutes
- STATES =
{ started: 0, finished: 1, failed: 2 }.freeze
ApplicationRecord::MAX_PLUCK
ResetOnUnionError::MAX_RESET_PERIOD
Class Method Summary
collapse
Instance Method Summary
collapse
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
#serializable_hash
Class Method Details
.generate_token ⇒ Object
96
97
98
|
# File 'app/models/service_desk/custom_email_verification.rb', line 96
def generate_token
SecureRandom.alphanumeric(12)
end
|
Instance Method Details
#accepted_until ⇒ Object
101
102
103
104
105
106
|
# File 'app/models/service_desk/custom_email_verification.rb', line 101
def accepted_until
return unless started?
return unless triggered_at.present?
TIMEFRAME.since(triggered_at)
end
|
#in_timeframe? ⇒ Boolean
108
109
110
111
112
|
# File 'app/models/service_desk/custom_email_verification.rb', line 108
def in_timeframe?
return false unless started?
!!accepted_until&.future?
end
|