{"action":"created","comment":{"url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/comments/77450692","id":77450692,"diff_hunk":"@@ -1,8 +1,9 @@\n # frozen_string_literal: true\n class UserPreferredEvent < ActiveRecord::Base\n   belongs_to :user\n+  belongs_to :event\n \n-  validates :event_id, inclusion: { in: Event.all_official.map(&:id) }\n+  validates :event_id, inclusion: { in: Event.official.map(&:id) }","path":"WcaOnRails/app/models/user_preferred_event.rb","position":7,"original_position":7,"commit_id":"f4848beeb062a849bdc77b9cca17e4b80d813a49","original_commit_id":"f4848beeb062a849bdc77b9cca17e4b80d813a49","user":{"login":"pingskills","id":4403168,"avatar_url":"https://avatars.githubusercontent.com/u/4403168?v=3","gravatar_id":"","url":"https://api.github.com/users/pingskills","html_url":"https://github.com/pingskills","followers_url":"https://api.github.com/users/pingskills/followers","following_url":"https://api.github.com/users/pingskills/following{/other_user}","gists_url":"https://api.github.com/users/pingskills/gists{/gist_id}","starred_url":"https://api.github.com/users/pingskills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingskills/subscriptions","organizations_url":"https://api.github.com/users/pingskills/orgs","repos_url":"https://api.github.com/users/pingskills/repos","events_url":"https://api.github.com/users/pingskills/events{/privacy}","received_events_url":"https://api.github.com/users/pingskills/received_events","type":"User","site_admin":false},"body":"@jonatanklosko Do I even need this validation now that we have the `belongs_to :event`?","created_at":"2016-09-04T11:11:54Z","updated_at":"2016-09-04T11:11:54Z","html_url":"https://github.com/cubing/worldcubeassociation.org/pull/759#discussion_r77450692","pull_request_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/759","_links":{"self":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/comments/77450692"},"html":{"href":"https://github.com/cubing/worldcubeassociation.org/pull/759#discussion_r77450692"},"pull_request":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/759"}}},"pull_request":{"url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/759","id":76062228,"html_url":"https://github.com/cubing/worldcubeassociation.org/pull/759","diff_url":"https://github.com/cubing/worldcubeassociation.org/pull/759.diff","patch_url":"https://github.com/cubing/worldcubeassociation.org/pull/759.patch","issue_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/759","number":759,"state":"open","locked":false,"title":"Clean up eventSpecs and virtual models - Fixes #95 - Fixes #741","user":{"login":"pingskills","id":4403168,"avatar_url":"https://avatars.githubusercontent.com/u/4403168?v=3","gravatar_id":"","url":"https://api.github.com/users/pingskills","html_url":"https://github.com/pingskills","followers_url":"https://api.github.com/users/pingskills/followers","following_url":"https://api.github.com/users/pingskills/following{/other_user}","gists_url":"https://api.github.com/users/pingskills/gists{/gist_id}","starred_url":"https://api.github.com/users/pingskills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingskills/subscriptions","organizations_url":"https://api.github.com/users/pingskills/orgs","repos_url":"https://api.github.com/users/pingskills/repos","events_url":"https://api.github.com/users/pingskills/events{/privacy}","received_events_url":"https://api.github.com/users/pingskills/received_events","type":"User","site_admin":false},"body":"**Not to be merged before PHP code is updated!**\r\n\r\n**Create competition_events table**\r\n    \r\nCreate a many to many table to hold competition events\r\nand migrate the data from the eventSpecs column. I am\r\nnot dropping the eventSpecs column in this migration so\r\nthe changes can easily be rolled back. This can be done\r\nin a later migration.\r\n\r\n**Convert Virtual Models Into Real Tables**\r\n    \r\nCountries, Continents, Events, Rounds, and Format models are\r\ncurrently virtual. This change makes the models reference the\r\ndatabase tables. A new table preferred_formats has been created\r\nto store the relationship between events and preferred formats.","created_at":"2016-07-02T10:51:31Z","updated_at":"2016-09-04T11:11:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"546c0373ca49de870b08cdd2bfd99a15a104a482","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/759/commits","review_comments_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/759/comments","review_comment_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/759/comments","statuses_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/statuses/f4848beeb062a849bdc77b9cca17e4b80d813a49","head":{"label":"pingskills:eventspecs95","ref":"eventspecs95","sha":"f4848beeb062a849bdc77b9cca17e4b80d813a49","user":{"login":"pingskills","id":4403168,"avatar_url":"https://avatars.githubusercontent.com/u/4403168?v=3","gravatar_id":"","url":"https://api.github.com/users/pingskills","html_url":"https://github.com/pingskills","followers_url":"https://api.github.com/users/pingskills/followers","following_url":"https://api.github.com/users/pingskills/following{/other_user}","gists_url":"https://api.github.com/users/pingskills/gists{/gist_id}","starred_url":"https://api.github.com/users/pingskills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingskills/subscriptions","organizations_url":"https://api.github.com/users/pingskills/orgs","repos_url":"https://api.github.com/users/pingskills/repos","events_url":"https://api.github.com/users/pingskills/events{/privacy}","received_events_url":"https://api.github.com/users/pingskills/received_events","type":"User","site_admin":false},"repo":{"id":56292449,"name":"worldcubeassociation.org","full_name":"pingskills/worldcubeassociation.org","owner":{"login":"pingskills","id":4403168,"avatar_url":"https://avatars.githubusercontent.com/u/4403168?v=3","gravatar_id":"","url":"https://api.github.com/users/pingskills","html_url":"https://github.com/pingskills","followers_url":"https://api.github.com/users/pingskills/followers","following_url":"https://api.github.com/users/pingskills/following{/other_user}","gists_url":"https://api.github.com/users/pingskills/gists{/gist_id}","starred_url":"https://api.github.com/users/pingskills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingskills/subscriptions","organizations_url":"https://api.github.com/users/pingskills/orgs","repos_url":"https://api.github.com/users/pingskills/repos","events_url":"https://api.github.com/users/pingskills/events{/privacy}","received_events_url":"https://api.github.com/users/pingskills/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pingskills/worldcubeassociation.org","description":"[WCA Project] All of the code that runs on worldcubeassociation.org","fork":true,"url":"https://api.github.com/repos/pingskills/worldcubeassociation.org","forks_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/forks","keys_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/teams","hooks_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/hooks","issue_events_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/issues/events{/number}","events_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/events","assignees_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/assignees{/user}","branches_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/branches{/branch}","tags_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/tags","blobs_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/statuses/{sha}","languages_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/languages","stargazers_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/stargazers","contributors_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/contributors","subscribers_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/subscribers","subscription_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/subscription","commits_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/contents/{+path}","compare_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/merges","archive_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/downloads","issues_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/issues{/number}","pulls_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/pulls{/number}","milestones_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/milestones{/number}","notifications_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/labels{/name}","releases_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/releases{/id}","deployments_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/deployments","created_at":"2016-04-15T05:05:13Z","updated_at":"2016-04-15T05:05:21Z","pushed_at":"2016-09-04T09:07:39Z","git_url":"git://github.com/pingskills/worldcubeassociation.org.git","ssh_url":"git@github.com:pingskills/worldcubeassociation.org.git","clone_url":"https://github.com/pingskills/worldcubeassociation.org.git","svn_url":"https://github.com/pingskills/worldcubeassociation.org","homepage":"https://www.worldcubeassociation.org/","size":55730,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cubing:master","ref":"master","sha":"a3948bde75de9cce3233192c8292d791399d871d","user":{"login":"cubing","id":1092267,"avatar_url":"https://avatars.githubusercontent.com/u/1092267?v=3","gravatar_id":"","url":"https://api.github.com/users/cubing","html_url":"https://github.com/cubing","followers_url":"https://api.github.com/users/cubing/followers","following_url":"https://api.github.com/users/cubing/following{/other_user}","gists_url":"https://api.github.com/users/cubing/gists{/gist_id}","starred_url":"https://api.github.com/users/cubing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cubing/subscriptions","organizations_url":"https://api.github.com/users/cubing/orgs","repos_url":"https://api.github.com/users/cubing/repos","events_url":"https://api.github.com/users/cubing/events{/privacy}","received_events_url":"https://api.github.com/users/cubing/received_events","type":"Organization","site_admin":false},"repo":{"id":34161579,"name":"worldcubeassociation.org","full_name":"cubing/worldcubeassociation.org","owner":{"login":"cubing","id":1092267,"avatar_url":"https://avatars.githubusercontent.com/u/1092267?v=3","gravatar_id":"","url":"https://api.github.com/users/cubing","html_url":"https://github.com/cubing","followers_url":"https://api.github.com/users/cubing/followers","following_url":"https://api.github.com/users/cubing/following{/other_user}","gists_url":"https://api.github.com/users/cubing/gists{/gist_id}","starred_url":"https://api.github.com/users/cubing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cubing/subscriptions","organizations_url":"https://api.github.com/users/cubing/orgs","repos_url":"https://api.github.com/users/cubing/repos","events_url":"https://api.github.com/users/cubing/events{/privacy}","received_events_url":"https://api.github.com/users/cubing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cubing/worldcubeassociation.org","description":"[WCA Project] All of the code that runs on worldcubeassociation.org","fork":false,"url":"https://api.github.com/repos/cubing/worldcubeassociation.org","forks_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/forks","keys_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/teams","hooks_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/hooks","issue_events_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/events{/number}","events_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/events","assignees_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/assignees{/user}","branches_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/branches{/branch}","tags_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/tags","blobs_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/statuses/{sha}","languages_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/languages","stargazers_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/stargazers","contributors_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/contributors","subscribers_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/subscribers","subscription_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/subscription","commits_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/contents/{+path}","compare_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/merges","archive_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/downloads","issues_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues{/number}","pulls_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls{/number}","milestones_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/milestones{/number}","notifications_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/labels{/name}","releases_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/releases{/id}","deployments_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/deployments","created_at":"2015-04-18T10:21:53Z","updated_at":"2016-07-31T18:31:59Z","pushed_at":"2016-09-04T10:18:51Z","git_url":"git://github.com/cubing/worldcubeassociation.org.git","ssh_url":"git@github.com:cubing/worldcubeassociation.org.git","clone_url":"https://github.com/cubing/worldcubeassociation.org.git","svn_url":"https://github.com/cubing/worldcubeassociation.org","homepage":"https://www.worldcubeassociation.org/","size":56304,"stargazers_count":22,"watchers_count":22,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":182,"forks":29,"open_issues":182,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/759"},"html":{"href":"https://github.com/cubing/worldcubeassociation.org/pull/759"},"issue":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/759"},"comments":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/759/comments"},"review_comments":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/759/comments"},"review_comment":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/759/commits"},"statuses":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/statuses/f4848beeb062a849bdc77b9cca17e4b80d813a49"}}}}
{"actor":{"display_login":"pingskills"}}