<commit_before># This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)
#


# Import legacy protected areas
###############################
source = File.join(Rails.root, 'lib', 'data', 'seeds', 'legacy_protected_areas.sql')
config = ActiveRecord::Base.connection_config
command = []

command << "PGPASSWORD=#{config["password"]}" if config["password"].present?
command << """
    psql -d #{config["database"]}
         -U #{config['username']}
         -h #{config['host']}
    < #{source.to_s}
""".squish

system(command.join(" "))

# Import models
###############
csv_models = [
  Jurisdiction, Governance,
  IucnCategory, Region, Country, SubLocation
]<commit_msg>use symbol for db config in seeds.rb<commit_after># This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)
#


# Import legacy protected areas
###############################
source = File.join(Rails.root, 'lib', 'data', 'seeds', 'legacy_protected_areas.sql')
config = ActiveRecord::Base.connection_config
command = []

command << "PGPASSWORD=#{config[:password]}" if config[:password].present?
command << %Q(psql -d #{config[:database]} -U #{config[:username]} -h #{config[:host]} < #{source.to_s})

system(command.join(" "))

# Import models
###############
csv_models = [
  Jurisdiction, Governance,
  IucnCategory, Region, Country, SubLocation
]
{'fraction_non_alphanumeric': 0.19481206987824246, 'fraction_numerical': 0.0, 'mean_word_length': 5.156351791530945, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, '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': '7406201', 'n_tokens_mistral': 581, 'n_tokens_neox': 573, 'n_words': 171}