Class: FormProfiles::VA21p527ez

Inherits:
FormProfile
  • Object
show all
Defined in:
app/models/form_profiles/va_21p527ez.rb

Overview

extends app/models/form_profile.rb, which handles form prefill

Instance Method Summary collapse

Instance Method Details

#initialize_military_informationObject

overrides FormProfile#initialize_military_information to use Pension21p527ez::PensionFormMilitaryInformation instead of FormProfile::FormMilitaryInformation in order to add additional military information fields.

See Also:

  • PensionFormMilitaryInformation
  • FormMilitaryInformation


20
21
22
23
24
25
26
27
# File 'app/models/form_profiles/va_21p527ez.rb', line 20

def initialize_military_information
  return {} unless user.authorize :va_profile, :access?

  military_information_data = {}
  military_information_data.merge!(initialize_va_profile_prefill_military_information)
  military_information_data[:vic_verified] = user.can_access_id_card?
  Pension21p527ez::PensionFormMilitaryInformation.new(military_information_data)
end

#initialize_va_profile_prefill_military_informationObject (private)

overrides FormProfile#initialize_va_profile_prefill_military_information Pension21p527ez::PensionMilitaryInformation instead of FormProfile::MilitaryInformation in order to add additional military information fields.

See Also:

  • PensionMilitaryInformation
  • MilitaryInformation


36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'app/models/form_profiles/va_21p527ez.rb', line 36

def initialize_va_profile_prefill_military_information
  military_information_data = {}
  military_information = Pension21p527ez::PensionMilitaryInformation.new(user)

  Pension21p527ez::PensionMilitaryInformation::PREFILL_METHODS.each do |attr|
    military_information_data[attr] = military_information.public_send(attr)
  end

  military_information_data
rescue => e
  log_exception_to_sentry(e, {}, prefill: :va_profile_prefill_military_information)

  {}
end

#metadataObject



7
8
9
10
11
12
13
# File 'app/models/form_profiles/va_21p527ez.rb', line 7

def 
  {
    version: 0,
    prefill: true,
    returnUrl: '/applicant/information'
  }
end