components/financial_assistance/app/models/financial_assistance/applicant.rb
# rubocop:disable Metrics/ClassLength TODO: Remove this
disable Metrics/ClassLength TODO: Remove this
disable Metrics / ClassLength TODO : Remove this
def clean_params(model_params) 
      model_params[:is_joint_tax_filing] = nil if model_params[:is_required_to_file_taxes].present? && model_params[:is_required_to_file_taxes] == 'false'
      model_params[:claimed_as_tax_dependent_by] = nil if model_params[:is_claimed_as_tax_dependent].present? && model_params[:is_claimed_as_tax_dependent] == 'false'
      if model_params[:is_pregnant].present? && model_params[:is_pregnant] == 'false'
        model_params[:pregnancy_due_on] = nil
        model_params[:children_expected_count] = nil
        model_params[:is_enrolled_on_medicaid] = nil if model_params[:is_post_partum_period] == "false"
      end
      if model_params[:is_pregnant].present? && model_params[:is_pregnant] == 'true'
        model_params[:is_post_partum_period] = nil
        model_params[:pregnancy_end_on] = nil
        model_params[:is_enrolled_on_medicaid] = nil
      end
      if model_params[:is_former_foster_care].present? && model_params[:is_former_foster_care] == 'false'
        model_params[:foster_care_us_state] = nil
        model_params[:age_left_foster_care] = nil
        model_params[:had_medicaid_during_foster_care] = nil
      end
      return unless model_params[:is_student].present? && model_params[:is_student] == 'false'
      model_params[:student_kind] = nil
      model_params[:student_status_end_on] = nil
      model_params[:student_kind] = nil
    end
def clean_params ( model_params ) model_params [ :is_joint_tax_filing ] = nil if model_params [ :is_required_to_file_taxes ] . present? && model_params [ :is_required_to_file_taxes ] == 'false' model_params [ :claimed_as_tax_dependent_by ] = nil if model_params [ :is_claimed_as_tax_dependent ] . present? && model_params [ :is_claimed_as_tax_dependent ] == 'false' if model_params [ :is_pregnant ] . present? && model_params [ :is_pregnant ] == 'false' model_params [ :pregnancy_due_on ] = nil model_params [ :children_expected_count ] = nil model_params [ :is_enrolled_on_medicaid ] = nil if model_params [ :is_post_partum_period ] == "false" end if model_params [ :is_pregnant ] . present? && model_params [ :is_pregnant ] == 'true' model_params [ :is_post_partum_period ] = nil model_params [ :pregnancy_end_on ] = nil model_params [ :is_enrolled_on_medicaid ] = nil end if model_params [ :is_former_foster_care ] . present? && model_params [ :is_former_foster_care ] == 'false' model_params [ :foster_care_us_state ] = nil model_params [ :age_left_foster_care ] = nil model_params [ :had_medicaid_during_foster_care ] = nil end return unless model_params [ :is_student ] . present? && model_params [ :is_student ] == 'false' model_params [ :student_kind ] = nil model_params [ :student_status_end_on ] = nil model_params [ :student_kind ] = nil end
rubocop:disable Metrics/ClassLength TODO: Remove this
rubocop : disable Metrics / ClassLength TODO : Remove this
# rubocop:disable Metrics/CyclomaticComplexity TODO: Remove this # TODO : Revise this logic for conditional saving!
model_params