components/financial_assistance/app/models/financial_assistance/applicant.rb
def age_on_effective_date
      return @age_on_effective_date unless @age_on_effective_date.blank?
      coverage_start_on = ::Forms::TimeKeeper.new.date_of_record
      return unless coverage_start_on.present?
      age = coverage_start_on.year - dob.year

      # Shave off one year if coverage starts before birthday
      if coverage_start_on.month == dob.month
        age -= 1 if coverage_start_on.day < dob.day
      elsif coverage_start_on.month < dob.month
        age -= 1
      end

      @age_on_effective_date = age
    end
# rubocop:disable Metrics/ClassLength TODO: Remove this
disable Metrics/ClassLength TODO: Remove this
disable Metrics / ClassLength TODO : Remove this
def age_on_effective_date
      return @age_on_effective_date unless @age_on_effective_date.blank?
      coverage_start_on = ::Forms::TimeKeeper.new.date_of_record
      return unless coverage_start_on.present?
      age = coverage_start_on.year - dob.year
      if coverage_start_on.month == dob.month
        age -= 1 if coverage_start_on.day < dob.day
      elsif coverage_start_on.month < dob.month
        age -= 1
      end
      @age_on_effective_date = age
    end
def age_on_effective_date return @age_on_effective_date unless @age_on_effective_date . blank? coverage_start_on = :: Forms :: TimeKeeper . new . date_of_record return unless coverage_start_on . present? age = coverage_start_on . year - dob . year if coverage_start_on . month == dob . month age -= 1 if coverage_start_on . day < dob . day elsif coverage_start_on . month < dob . month age -= 1 end @age_on_effective_date = age end
rubocop:disable Metrics/ClassLength TODO: Remove this
rubocop : disable Metrics / ClassLength TODO : Remove this
# Shave off one year if coverage starts before birthday