<commit_before>#encoding: utf-8

# determine if we are using postgres or mysql
is_mysql = (ActiveRecord::Base.configurations[Rails.env]['adapter'] == 'mysql2')
is_sqlite =  (ActiveRecord::Base.configurations[Rails.env]['adapter'] == 'sqlite3')

#------------------------------------------------------------------------------
#
# Lookup Tables
#
# These are the lookup tables for TransAM Funding
#
#------------------------------------------------------------------------------

puts "======= Processing TransAM Funding Lookup Tables  ======="

funding_template_types = [
    {:active => 1, :name => 'Capital', :description => 'Capital Funding Template'},
    {:active => 1, :name => 'Operating', :description => 'Operating Funding Template'},
    {:active => 1, :name => 'Debt Service', :description => 'Debt Service Funding Template'},
    {:active => 1, :name => 'Other', :description => 'Other Funding Template'},
]

funding_bucket_types = [
    {:active => 1, :name => 'Existing Grant', :description => 'Existing Grant'},
    {:active => 1, :name => 'Formula', :description => 'Formula Bucket'},
    {:active => 1, :name => 'Grant Application', :description => 'Grant Application Bucket'},
]
lookup_tables = %w{ funding_source_types general_ledger_account_types funding_template_types funding_bucket_types}

lookup_tables.each do |table_name|
  puts "  Loading #{table_name}"
  if is_mysql
    ActiveRecord::Base.connection.execute("TRUNCATE TABLE #{table_name};")
  elsif is_sqlite
    ActiveRecord::Base.connection.execute("DELETE FROM #{table_name};")
  else<commit_msg>Update lookup tables changed in seed<commit_after>#encoding: utf-8

# determine if we are using postgres or mysql
is_mysql = (ActiveRecord::Base.configurations[Rails.env]['adapter'] == 'mysql2')
is_sqlite =  (ActiveRecord::Base.configurations[Rails.env]['adapter'] == 'sqlite3')

#------------------------------------------------------------------------------
#
# Lookup Tables
#
# These are the lookup tables for TransAM Funding
#
#------------------------------------------------------------------------------

puts "======= Processing TransAM Funding Lookup Tables  ======="

funding_template_types = [
    {:active => 1, :name => 'Capital', :description => 'Capital Funding Template'},
    {:active => 1, :name => 'Operating', :description => 'Operating Funding Template'},
    {:active => 1, :name => 'Debt Service', :description => 'Debt Service Funding Template'},
    {:active => 1, :name => 'Other', :description => 'Other Funding Template'},
]

funding_bucket_types = [
    {:active => 1, :name => 'Existing Grant', :description => 'Existing Grant'},
    {:active => 1, :name => 'Formula', :description => 'Formula Bucket'},
    {:active => 1, :name => 'Grant Application', :description => 'Grant Application Bucket'},
]
lookup_tables = %w{ funding_template_types funding_bucket_types}

lookup_tables.each do |table_name|
  puts "  Loading #{table_name}"
  if is_mysql
    ActiveRecord::Base.connection.execute("TRUNCATE TABLE #{table_name};")
  elsif is_sqlite
    ActiveRecord::Base.connection.execute("DELETE FROM #{table_name};")
  else
{'fraction_non_alphanumeric': 0.24816117684681804, 'fraction_numerical': 0.0063959066197633516, 'mean_word_length': 3.1375661375661377, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1616184', 'n_tokens_mistral': 905, 'n_tokens_neox': 856, 'n_words': 232}