components/financial_assistance/app/models/financial_assistance/applicant.rb
# Case1: Missing address - No address objects at all
# Case2: Invalid Address - No addresses matching the state
# Case3: Unable to get rating area(home_address || mailing_address)
Missing address - No address objects at all
Case2: Invalid Address - No addresses matching the state
Case3: Unable to get rating area(home_address || mailing_address)
Missing address - No address objects at all Case2 : Invalid Address - No addresses matching the state Case3 : Unable to get rating area ( home_address || mailing_address )
def has_valid_address?
      addresses.where(
        state: FinancialAssistanceRegistry[:enroll_app].setting(:state_abbreviation).item,
        :kind.in => ['home', 'mailing']
      ).present?
    end
def has_valid_address? addresses . where ( state : FinancialAssistanceRegistry [ :enroll_app ] . setting ( :state_abbreviation ) . item , :kind . in => [ 'home' , 'mailing' ] ) . present? end
Case1: Missing address - No address objects at all
Case2: Invalid Address - No addresses matching the state
Case3: Unable to get rating area(home_address || mailing_address)
Case1 : Missing address - No address objects at all Case2 : Invalid Address - No addresses matching the state Case3 : Unable to get rating area ( home_address || mailing_address )