components/financial_assistance/app/models/financial_assistance/application.rb
# rubocop:disable Metrics/ClassLength TODO: Remove this
disable Metrics/ClassLength TODO: Remove this
disable Metrics / ClassLength TODO : Remove this
def search_applicant(verified_family_member)
      ssn = verified_family_member.person_demographics.ssn
      ssn = '' if ssn == "999999999"
      dob = verified_family_member.person_demographics.birth_date
      last_name_regex = /^#{verified_family_member.person.name_last}$/i
      first_name_regex = /^#{verified_family_member.person.name_first}$/i
      if ssn.blank?
        applicants.where({
                           :dob => dob,
                           :last_name => last_name_regex,
                           :first_name => first_name_regex
                         }).first
      else
        applicants.where({
                           :encrypted_ssn => FinancialAssistance::Applicant.encrypt_ssn(ssn),
                           :dob => dob
                         }).first
      end
    end
def search_applicant ( verified_family_member ) ssn = verified_family_member . person_demographics . ssn ssn = '' if ssn == "999999999" dob = verified_family_member . person_demographics . birth_date last_name_regex = / ^ #{ verified_family_member . person . name_last } $ /i first_name_regex = / ^ #{ verified_family_member . person . name_first } $ /i if ssn . blank? applicants . where ( { :dob => dob , :last_name => last_name_regex , :first_name => first_name_regex } ) . first else applicants . where ( { :encrypted_ssn => FinancialAssistance :: Applicant . encrypt_ssn ( ssn ) , :dob => dob } ) . first end end
rubocop:disable Metrics/ClassLength TODO: Remove this
rubocop : disable Metrics / ClassLength TODO : Remove this
verified_family_member