<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)<commit_msg>working on seeding 311 data<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)
require 'json'

resource_path = "db"
json_file = File.read(Rails.root.join(resource_path, "311_pave.json"))
json_data = JSON.parse(json_file)

json_data.each do |pave_data|
  issue = Issue.find_or_create_by(api_id: pave_data[:service_request_id],
                                  api_status: pave_data[:status],
                                  service_code: pave_data[:service_code],
                                  lonlat: 'POINT(#{pave_data[:long]} #{pave_data[:lat]})')
end
{'fraction_non_alphanumeric': 0.11831442463533225, 'fraction_numerical': 0.004862236628849271, 'mean_word_length': 3.5238095238095237, 'pattern_counts': {'":': 0, '<': 3, '<?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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3973855', 'n_tokens_mistral': 387, 'n_tokens_neox': 372, 'n_words': 118}