Class: EducationStemAutomatedDecision

Inherits:
ApplicationRecord show all
Defined in:
app/models/education_stem_automated_decision.rb

Constant Summary collapse

INIT =
'init'
PROCESSED =
'processed'
DENIED =
'denied'
DECISION_STATES =
[INIT, PROCESSED, DENIED].freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApplicationRecord

descendants_using_encryption, lockbox_options, #timestamp_attributes_for_update_in_model, #valid?

Class Method Details

.deniedObject



26
27
28
# File 'app/models/education_stem_automated_decision.rb', line 26

def self.denied
  where(automated_decision_state: DENIED)
end

.initObject



18
19
20
# File 'app/models/education_stem_automated_decision.rb', line 18

def self.init
  where(automated_decision_state: INIT)
end

.processedObject



22
23
24
# File 'app/models/education_stem_automated_decision.rb', line 22

def self.processed
  where(automated_decision_state: PROCESSED)
end

Instance Method Details

#auth_headersHash

Returns parsed auth headers.

Returns:

  • (Hash)

    parsed auth headers



32
33
34
35
36
# File 'app/models/education_stem_automated_decision.rb', line 32

def auth_headers
  return nil if auth_headers_json.nil?

  @auth_headers_hash ||= JSON.parse(auth_headers_json)
end