{"action":"created","comment":{"url":"https://api.github.com/repos/emanoppo/open_ed_data/pulls/comments/28639985","id":28639985,"diff_hunk":"@@ -1,7 +1,474 @@\n # This file should contain all the record creation needed to seed the database with its default values.\n # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).\n-#\n-# Examples:\n-#\n-#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])\n-#   Mayor.create(name: 'Emanuel', city: cities.first)\n+\n+# Dataset code translations, based on PDF documentation.\n+\n+require 'csv'\n+\n+school_levels = {\n+  \"1\" => \"Primary\",\n+  \"2\" => \"Middle\",\n+  \"3\" => \"High\",\n+  \"4\" => \"Other\",\n+  \"M\" => \"Missing data\",\n+  \"N\" => \"Not applicable\"\n+}\n+\n+school_levels.each do |nces_id, name|\n+  SchoolLevel.find_or_create_by!(nces_id: nces_id, school_level_name: name)\n+end\n+\n+puts \"School levels populated.\"\n+\n+school_types = {\n+  \"1\" => \"Regular school\",\n+  \"2\" => \"Special education school\",\n+  \"3\" => \"Vocational school\",\n+  \"4\" => \"Other/alternative school\",\n+  \"5\" => \"Reportable program\",\n+  \"M\" => \"Missing data\",\n+  \"N\" => \"Not applicable\"\n+}\n+\n+school_types.each do |nces_id, name|\n+  SchoolType.find_or_create_by!(nces_id: nces_id, school_type_name: name)\n+end\n+\n+puts \"School types populated.\"\n+\n+school_charters = {\n+  \"1\" => \"Yes\",\n+  \"2\" => \"No\",\n+  \"M\" => \"Missing data\",\n+  \"N\" => \"Not applicable\"\n+}\n+\n+school_charters.each do |nces_id, name|\n+  SchoolCharter.find_or_create_by!(nces_id: nces_id, school_charter_name: name)\n+end\n+\n+puts \"School charters populated.\"\n+\n+school_magnets = {\n+  \"1\" => \"Yes\",\n+  \"2\" => \"No\",\n+  \"M\" => \"Missing data\",\n+  \"N\" => \"Not applicable\"\n+}\n+\n+school_magnets.each do |nces_id, name|\n+  SchoolMagnet.find_or_create_by!(nces_id: nces_id, school_magnet_name: name)\n+end\n+\n+puts \"School magnets populated.\"\n+\n+school_title_ones = {\n+  \"1\" => {\n+    eligible: \"Eligible for Title I Targeted Assistance (TAS)\",\n+    program: \"Provides no program\"\n+  },\n+  \"2\" => {\n+    eligible: \"Eligible for Title I Targeted Assistance (TAS)\",\n+    program: \"Provides TAS program\"\n+  },\n+  \"3\" => {\n+    eligible: \"Eligible for Title I Schoolwide program (SWP)\",\n+    program: \"Provides TAS program\"\n+  },\n+  \"4\" => {\n+    eligible: \"Eligible for Title I Schoolwide program (SWP)\",\n+    program: \"Provides no program\"\n+  },\n+  \"5\" => {\n+    eligible: \"Eligible for Title I Schoolwide program (SWP)\",\n+    program: \"Provides Title I Schoolwide program\"\n+  },\n+  \"6\" => {\n+    eligible: \"Not eligible for Title I Targeted Assistance (TAS) or \" +\n+      \"Schoolwide program\",\n+    program: \"Not applicable\"\n+  }\n+}\n+\n+school_title_ones.each do |nces_id, title_one|\n+  SchoolTitleOne.find_or_create_by!(\n+    nces_id: nces_id,\n+    school_title_one_eligible: title_one[:eligible],\n+    school_title_one_program: title_one[:program]\n+  )\n+end\n+\n+puts \"School Title I's populated.\"","path":"db/seeds.rb","position":106,"original_position":106,"commit_id":"de1dbe55b95f481354d90d471106783fc4ddd132","original_commit_id":"de1dbe55b95f481354d90d471106783fc4ddd132","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Do not write to stdout. Use Rails' logger if you want to log.","created_at":"2015-04-18T01:22:16Z","updated_at":"2015-04-18T01:22:16Z","html_url":"https://github.com/emanoppo/open_ed_data/pull/3#discussion_r28639985","pull_request_url":"https://api.github.com/repos/emanoppo/open_ed_data/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/emanoppo/open_ed_data/pulls/comments/28639985"},"html":{"href":"https://github.com/emanoppo/open_ed_data/pull/3#discussion_r28639985"},"pull_request":{"href":"https://api.github.com/repos/emanoppo/open_ed_data/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/emanoppo/open_ed_data/pulls/3","id":33376167,"html_url":"https://github.com/emanoppo/open_ed_data/pull/3","diff_url":"https://github.com/emanoppo/open_ed_data/pull/3.diff","patch_url":"https://github.com/emanoppo/open_ed_data/pull/3.patch","issue_url":"https://api.github.com/repos/emanoppo/open_ed_data/issues/3","number":3,"state":"open","locked":false,"title":"Add initial data","user":{"login":"emanoppo","id":7308928,"avatar_url":"https://avatars.githubusercontent.com/u/7308928?v=3","gravatar_id":"","url":"https://api.github.com/users/emanoppo","html_url":"https://github.com/emanoppo","followers_url":"https://api.github.com/users/emanoppo/followers","following_url":"https://api.github.com/users/emanoppo/following{/other_user}","gists_url":"https://api.github.com/users/emanoppo/gists{/gist_id}","starred_url":"https://api.github.com/users/emanoppo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emanoppo/subscriptions","organizations_url":"https://api.github.com/users/emanoppo/orgs","repos_url":"https://api.github.com/users/emanoppo/repos","events_url":"https://api.github.com/users/emanoppo/events{/privacy}","received_events_url":"https://api.github.com/users/emanoppo/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-15T17:11:49Z","updated_at":"2015-04-18T01:22:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59614a8ab8a1c2d6251fbb86f9bf6794169e3072","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/emanoppo/open_ed_data/pulls/3/commits","review_comments_url":"https://api.github.com/repos/emanoppo/open_ed_data/pulls/3/comments","review_comment_url":"https://api.github.com/repos/emanoppo/open_ed_data/pulls/comments{/number}","comments_url":"https://api.github.com/repos/emanoppo/open_ed_data/issues/3/comments","statuses_url":"https://api.github.com/repos/emanoppo/open_ed_data/statuses/de1dbe55b95f481354d90d471106783fc4ddd132","head":{"label":"emanoppo:add_initial_data","ref":"add_initial_data","sha":"de1dbe55b95f481354d90d471106783fc4ddd132","user":{"login":"emanoppo","id":7308928,"avatar_url":"https://avatars.githubusercontent.com/u/7308928?v=3","gravatar_id":"","url":"https://api.github.com/users/emanoppo","html_url":"https://github.com/emanoppo","followers_url":"https://api.github.com/users/emanoppo/followers","following_url":"https://api.github.com/users/emanoppo/following{/other_user}","gists_url":"https://api.github.com/users/emanoppo/gists{/gist_id}","starred_url":"https://api.github.com/users/emanoppo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emanoppo/subscriptions","organizations_url":"https://api.github.com/users/emanoppo/orgs","repos_url":"https://api.github.com/users/emanoppo/repos","events_url":"https://api.github.com/users/emanoppo/events{/privacy}","received_events_url":"https://api.github.com/users/emanoppo/received_events","type":"User","site_admin":false},"repo":{"id":33620800,"name":"open_ed_data","full_name":"emanoppo/open_ed_data","owner":{"login":"emanoppo","id":7308928,"avatar_url":"https://avatars.githubusercontent.com/u/7308928?v=3","gravatar_id":"","url":"https://api.github.com/users/emanoppo","html_url":"https://github.com/emanoppo","followers_url":"https://api.github.com/users/emanoppo/followers","following_url":"https://api.github.com/users/emanoppo/following{/other_user}","gists_url":"https://api.github.com/users/emanoppo/gists{/gist_id}","starred_url":"https://api.github.com/users/emanoppo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emanoppo/subscriptions","organizations_url":"https://api.github.com/users/emanoppo/orgs","repos_url":"https://api.github.com/users/emanoppo/repos","events_url":"https://api.github.com/users/emanoppo/events{/privacy}","received_events_url":"https://api.github.com/users/emanoppo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/emanoppo/open_ed_data","description":"","fork":false,"url":"https://api.github.com/repos/emanoppo/open_ed_data","forks_url":"https://api.github.com/repos/emanoppo/open_ed_data/forks","keys_url":"https://api.github.com/repos/emanoppo/open_ed_data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emanoppo/open_ed_data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emanoppo/open_ed_data/teams","hooks_url":"https://api.github.com/repos/emanoppo/open_ed_data/hooks","issue_events_url":"https://api.github.com/repos/emanoppo/open_ed_data/issues/events{/number}","events_url":"https://api.github.com/repos/emanoppo/open_ed_data/events","assignees_url":"https://api.github.com/repos/emanoppo/open_ed_data/assignees{/user}","branches_url":"https://api.github.com/repos/emanoppo/open_ed_data/branches{/branch}","tags_url":"https://api.github.com/repos/emanoppo/open_ed_data/tags","blobs_url":"https://api.github.com/repos/emanoppo/open_ed_data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emanoppo/open_ed_data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emanoppo/open_ed_data/git/refs{/sha}","trees_url":"https://api.github.com/repos/emanoppo/open_ed_data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emanoppo/open_ed_data/statuses/{sha}","languages_url":"https://api.github.com/repos/emanoppo/open_ed_data/languages","stargazers_url":"https://api.github.com/repos/emanoppo/open_ed_data/stargazers","contributors_url":"https://api.github.com/repos/emanoppo/open_ed_data/contributors","subscribers_url":"https://api.github.com/repos/emanoppo/open_ed_data/subscribers","subscription_url":"https://api.github.com/repos/emanoppo/open_ed_data/subscription","commits_url":"https://api.github.com/repos/emanoppo/open_ed_data/commits{/sha}","git_commits_url":"https://api.github.com/repos/emanoppo/open_ed_data/git/commits{/sha}","comments_url":"https://api.github.com/repos/emanoppo/open_ed_data/comments{/number}","issue_comment_url":"https://api.github.com/repos/emanoppo/open_ed_data/issues/comments{/number}","contents_url":"https://api.github.com/repos/emanoppo/open_ed_data/contents/{+path}","compare_url":"https://api.github.com/repos/emanoppo/open_ed_data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emanoppo/open_ed_data/merges","archive_url":"https://api.github.com/repos/emanoppo/open_ed_data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emanoppo/open_ed_data/downloads","issues_url":"https://api.github.com/repos/emanoppo/open_ed_data/issues{/number}","pulls_url":"https://api.github.com/repos/emanoppo/open_ed_data/pulls{/number}","milestones_url":"https://api.github.com/repos/emanoppo/open_ed_data/milestones{/number}","notifications_url":"https://api.github.com/repos/emanoppo/open_ed_data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emanoppo/open_ed_data/labels{/name}","releases_url":"https://api.github.com/repos/emanoppo/open_ed_data/releases{/id}","created_at":"2015-04-08T17:13:33Z","updated_at":"2015-04-14T22:42:40Z","pushed_at":"2015-04-18T01:22:08Z","git_url":"git://github.com/emanoppo/open_ed_data.git","ssh_url":"git@github.com:emanoppo/open_ed_data.git","clone_url":"https://github.com/emanoppo/open_ed_data.git","svn_url":"https://github.com/emanoppo/open_ed_data","homepage":null,"size":264,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"emanoppo:master","ref":"master","sha":"cf51e0dc43e0b850e0c5641728495cf09670d6c7","user":{"login":"emanoppo","id":7308928,"avatar_url":"https://avatars.githubusercontent.com/u/7308928?v=3","gravatar_id":"","url":"https://api.github.com/users/emanoppo","html_url":"https://github.com/emanoppo","followers_url":"https://api.github.com/users/emanoppo/followers","following_url":"https://api.github.com/users/emanoppo/following{/other_user}","gists_url":"https://api.github.com/users/emanoppo/gists{/gist_id}","starred_url":"https://api.github.com/users/emanoppo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emanoppo/subscriptions","organizations_url":"https://api.github.com/users/emanoppo/orgs","repos_url":"https://api.github.com/users/emanoppo/repos","events_url":"https://api.github.com/users/emanoppo/events{/privacy}","received_events_url":"https://api.github.com/users/emanoppo/received_events","type":"User","site_admin":false},"repo":{"id":33620800,"name":"open_ed_data","full_name":"emanoppo/open_ed_data","owner":{"login":"emanoppo","id":7308928,"avatar_url":"https://avatars.githubusercontent.com/u/7308928?v=3","gravatar_id":"","url":"https://api.github.com/users/emanoppo","html_url":"https://github.com/emanoppo","followers_url":"https://api.github.com/users/emanoppo/followers","following_url":"https://api.github.com/users/emanoppo/following{/other_user}","gists_url":"https://api.github.com/users/emanoppo/gists{/gist_id}","starred_url":"https://api.github.com/users/emanoppo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emanoppo/subscriptions","organizations_url":"https://api.github.com/users/emanoppo/orgs","repos_url":"https://api.github.com/users/emanoppo/repos","events_url":"https://api.github.com/users/emanoppo/events{/privacy}","received_events_url":"https://api.github.com/users/emanoppo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/emanoppo/open_ed_data","description":"","fork":false,"url":"https://api.github.com/repos/emanoppo/open_ed_data","forks_url":"https://api.github.com/repos/emanoppo/open_ed_data/forks","keys_url":"https://api.github.com/repos/emanoppo/open_ed_data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emanoppo/open_ed_data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emanoppo/open_ed_data/teams","hooks_url":"https://api.github.com/repos/emanoppo/open_ed_data/hooks","issue_events_url":"https://api.github.com/repos/emanoppo/open_ed_data/issues/events{/number}","events_url":"https://api.github.com/repos/emanoppo/open_ed_data/events","assignees_url":"https://api.github.com/repos/emanoppo/open_ed_data/assignees{/user}","branches_url":"https://api.github.com/repos/emanoppo/open_ed_data/branches{/branch}","tags_url":"https://api.github.com/repos/emanoppo/open_ed_data/tags","blobs_url":"https://api.github.com/repos/emanoppo/open_ed_data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emanoppo/open_ed_data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emanoppo/open_ed_data/git/refs{/sha}","trees_url":"https://api.github.com/repos/emanoppo/open_ed_data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emanoppo/open_ed_data/statuses/{sha}","languages_url":"https://api.github.com/repos/emanoppo/open_ed_data/languages","stargazers_url":"https://api.github.com/repos/emanoppo/open_ed_data/stargazers","contributors_url":"https://api.github.com/repos/emanoppo/open_ed_data/contributors","subscribers_url":"https://api.github.com/repos/emanoppo/open_ed_data/subscribers","subscription_url":"https://api.github.com/repos/emanoppo/open_ed_data/subscription","commits_url":"https://api.github.com/repos/emanoppo/open_ed_data/commits{/sha}","git_commits_url":"https://api.github.com/repos/emanoppo/open_ed_data/git/commits{/sha}","comments_url":"https://api.github.com/repos/emanoppo/open_ed_data/comments{/number}","issue_comment_url":"https://api.github.com/repos/emanoppo/open_ed_data/issues/comments{/number}","contents_url":"https://api.github.com/repos/emanoppo/open_ed_data/contents/{+path}","compare_url":"https://api.github.com/repos/emanoppo/open_ed_data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emanoppo/open_ed_data/merges","archive_url":"https://api.github.com/repos/emanoppo/open_ed_data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emanoppo/open_ed_data/downloads","issues_url":"https://api.github.com/repos/emanoppo/open_ed_data/issues{/number}","pulls_url":"https://api.github.com/repos/emanoppo/open_ed_data/pulls{/number}","milestones_url":"https://api.github.com/repos/emanoppo/open_ed_data/milestones{/number}","notifications_url":"https://api.github.com/repos/emanoppo/open_ed_data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emanoppo/open_ed_data/labels{/name}","releases_url":"https://api.github.com/repos/emanoppo/open_ed_data/releases{/id}","created_at":"2015-04-08T17:13:33Z","updated_at":"2015-04-14T22:42:40Z","pushed_at":"2015-04-18T01:22:08Z","git_url":"git://github.com/emanoppo/open_ed_data.git","ssh_url":"git@github.com:emanoppo/open_ed_data.git","clone_url":"https://github.com/emanoppo/open_ed_data.git","svn_url":"https://github.com/emanoppo/open_ed_data","homepage":null,"size":264,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/emanoppo/open_ed_data/pulls/3"},"html":{"href":"https://github.com/emanoppo/open_ed_data/pull/3"},"issue":{"href":"https://api.github.com/repos/emanoppo/open_ed_data/issues/3"},"comments":{"href":"https://api.github.com/repos/emanoppo/open_ed_data/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/emanoppo/open_ed_data/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/emanoppo/open_ed_data/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/emanoppo/open_ed_data/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/emanoppo/open_ed_data/statuses/de1dbe55b95f481354d90d471106783fc4ddd132"}}}}