app/data_migrations/create_all_qualifying_life_event_kinds.rb
def generate_qlek_csv
    return unless Rails.env.development?
    puts("Beginning Qualifying Life Event Kind report")
    field_names = [
      "event_kind_label", "action_kind", "title", "effective_on_kinds", "reason", "edi_code",
      "market_kind", "tool_tip", "pre_event_sep_in_days", "is_self_attested", "date_options_available", "post_event_sep_in_days",
      "ordinal_position", "aasm_state", "is_active", "event_on", "qle_event_date_kind", "coverage_effective_on",
      "start_on", "end_on", "is_visible", "termination_on_kinds", "coverage_start_on", "coverage_end_on",
      "updated_by", "published_by", "created_by"
    ]
    file_name = "#{Rails.root}/qualifying_life_event_kinds_report.csv"
    FileUtils.touch(file_name) unless File.exist?(file_name)
    qleks = QualifyingLifeEventKind.all
    CSV.open(file_name, 'w+', headers: true) do |csv|
      csv << field_names
      qleks.each do |qlek|
        qlek_attrs = qlek.attributes
        csv << field_names.map { |field_name| qlek_attrs[field_name] }
      end
    end
    puts("Finished Qualifying Life Event Kind report")
  end
# Only used for creaeting a report of all Qualifying Life Event Kinds for a given client
# Do not uncomment or run if not on environment
Only used for creaeting a report of all Qualifying Life Event Kinds for a given client
Do not uncomment or run if not on environment
Only used for creaeting a report of all Qualifying Life Event Kinds for a given client Do not uncomment or run if not on environment
def generate_qlek_csv
    return unless Rails.env.development?
    puts("Beginning Qualifying Life Event Kind report")
    field_names = [
      "event_kind_label", "action_kind", "title", "effective_on_kinds", "reason", "edi_code",
      "market_kind", "tool_tip", "pre_event_sep_in_days", "is_self_attested", "date_options_available", "post_event_sep_in_days",
      "ordinal_position", "aasm_state", "is_active", "event_on", "qle_event_date_kind", "coverage_effective_on",
      "start_on", "end_on", "is_visible", "termination_on_kinds", "coverage_start_on", "coverage_end_on",
      "updated_by", "published_by", "created_by"
    ]
    file_name = "#{Rails.root}/qualifying_life_event_kinds_report.csv"
    FileUtils.touch(file_name) unless File.exist?(file_name)
    qleks = QualifyingLifeEventKind.all
    CSV.open(file_name, 'w+', headers: true) do |csv|
      csv << field_names
      qleks.each do |qlek|
        qlek_attrs = qlek.attributes
        csv << field_names.map { |field_name| qlek_attrs[field_name] }
      end
    end
    puts("Finished Qualifying Life Event Kind report")
  end
def generate_qlek_csv return unless Rails . env . development? puts ( "Beginning Qualifying Life Event Kind report" ) field_names = [ "event_kind_label" , "action_kind" , "title" , "effective_on_kinds" , "reason" , "edi_code" , "market_kind" , "tool_tip" , "pre_event_sep_in_days" , "is_self_attested" , "date_options_available" , "post_event_sep_in_days" , "ordinal_position" , "aasm_state" , "is_active" , "event_on" , "qle_event_date_kind" , "coverage_effective_on" , "start_on" , "end_on" , "is_visible" , "termination_on_kinds" , "coverage_start_on" , "coverage_end_on" , "updated_by" , "published_by" , "created_by" ] file_name = "#{Rails.root}/qualifying_life_event_kinds_report.csv" FileUtils . touch ( file_name ) unless File . exist? ( file_name ) qleks = QualifyingLifeEventKind . all CSV . open ( file_name , 'w+' , headers : true ) do | csv | csv << field_names qleks . each do | qlek | qlek_attrs = qlek . attributes csv << field_names . map { | field_name | qlek_attrs [ field_name ] } end end puts ( "Finished Qualifying Life Event Kind report" ) end
Only used for creaeting a report of all Qualifying Life Event Kinds for a given client
Do not uncomment or run if not on environment
Only used for creaeting a report of all Qualifying Life Event Kinds for a given client Do not uncomment or run if not on environment