{"action":"created","comment":{"url":"https://api.github.com/repos/joecorcoran/judge/pulls/comments/87707349","pull_request_review_id":8310804,"id":87707349,"diff_hunk":"@@ -8,24 +8,24 @@ class Config\n     @@ignore_unsupported_validators = false\n \n     def expose(klass, *attributes)\n-      attrs = (@@exposed[klass] ||= [])\n+      attrs = (@@exposed[klass.name] ||= [])\n       attrs.concat(attributes).uniq!\n     end\n \n     def exposed\n-      @@exposed\n+      @@exposed.map { |k, v| [k.constantize, v] }.to_h","path":"lib/judge/config.rb","position":11,"original_position":11,"commit_id":"f88c1e5f30175fae1b031f81f7009045450c3875","original_commit_id":"f88c1e5f30175fae1b031f81f7009045450c3875","user":{"login":"jamesmk","id":447575,"avatar_url":"https://avatars.githubusercontent.com/u/447575?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesmk","html_url":"https://github.com/jamesmk","followers_url":"https://api.github.com/users/jamesmk/followers","following_url":"https://api.github.com/users/jamesmk/following{/other_user}","gists_url":"https://api.github.com/users/jamesmk/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesmk/subscriptions","organizations_url":"https://api.github.com/users/jamesmk/orgs","repos_url":"https://api.github.com/users/jamesmk/repos","events_url":"https://api.github.com/users/jamesmk/events{/privacy}","received_events_url":"https://api.github.com/users/jamesmk/received_events","type":"User","site_admin":false},"body":"@hgani It looks like you added this to get some tests to pass, but I'm thinking it may be the tests that need to be adjusted. First, it looks like Ruby 1.9.3 doesn't like the usage of `to_h` here (whether or not we should be still supporting 1.9.3 is another topic). When I reverted this change and updated the tests to use a stringed key, instead of class, they passed.\r\n\r\n```ruby\r\nJudge.config.exposed['User'].should eql [:username, :email]\r\n``` \r\n\r\nI don't think `Judge.config.exposed` is part of the documented external API and the only usage internal.\r\n\r\n@joecorcoran Any opinions here?","created_at":"2016-11-13T07:46:33Z","updated_at":"2016-11-13T07:46:45Z","html_url":"https://github.com/joecorcoran/judge/pull/78#discussion_r87707349","pull_request_url":"https://api.github.com/repos/joecorcoran/judge/pulls/78","_links":{"self":{"href":"https://api.github.com/repos/joecorcoran/judge/pulls/comments/87707349"},"html":{"href":"https://github.com/joecorcoran/judge/pull/78#discussion_r87707349"},"pull_request":{"href":"https://api.github.com/repos/joecorcoran/judge/pulls/78"}}},"pull_request":{"url":"https://api.github.com/repos/joecorcoran/judge/pulls/78","id":93259077,"html_url":"https://github.com/joecorcoran/judge/pull/78","diff_url":"https://github.com/joecorcoran/judge/pull/78.diff","patch_url":"https://github.com/joecorcoran/judge/pull/78.patch","issue_url":"https://api.github.com/repos/joecorcoran/judge/issues/78","number":78,"state":"open","locked":false,"title":"Fix uniqueness validation after source code changes","user":{"login":"hgani","id":417160,"avatar_url":"https://avatars.githubusercontent.com/u/417160?v=3","gravatar_id":"","url":"https://api.github.com/users/hgani","html_url":"https://github.com/hgani","followers_url":"https://api.github.com/users/hgani/followers","following_url":"https://api.github.com/users/hgani/following{/other_user}","gists_url":"https://api.github.com/users/hgani/gists{/gist_id}","starred_url":"https://api.github.com/users/hgani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgani/subscriptions","organizations_url":"https://api.github.com/users/hgani/orgs","repos_url":"https://api.github.com/users/hgani/repos","events_url":"https://api.github.com/users/hgani/events{/privacy}","received_events_url":"https://api.github.com/users/hgani/received_events","type":"User","site_admin":false},"body":"This fixes an issue that has been reported multiple times:\r\nhttps://github.com/joecorcoran/judge/issues/17\r\nhttps://github.com/joecorcoran/judge/issues/24\r\n\r\nThere has been a suggested workaround, but the workaround doesn't work for me. \r\n\r\nThis pull request aims to fix this problem properly so no workaround is needed.\r\n\r\nBasically what it does is use class name as the key for `expose` instead of using the class itself, which will break when Rails autoloads the class, because then the existing key/class will not match with the reloaded class.\r\n\r\nThanks","created_at":"2016-11-11T00:31:14Z","updated_at":"2016-11-13T07:46:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b85744f057c1aec35909f64646adebb7ecc43870","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/joecorcoran/judge/pulls/78/commits","review_comments_url":"https://api.github.com/repos/joecorcoran/judge/pulls/78/comments","review_comment_url":"https://api.github.com/repos/joecorcoran/judge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joecorcoran/judge/issues/78/comments","statuses_url":"https://api.github.com/repos/joecorcoran/judge/statuses/f88c1e5f30175fae1b031f81f7009045450c3875","head":{"label":"hgani:master","ref":"master","sha":"f88c1e5f30175fae1b031f81f7009045450c3875","user":{"login":"hgani","id":417160,"avatar_url":"https://avatars.githubusercontent.com/u/417160?v=3","gravatar_id":"","url":"https://api.github.com/users/hgani","html_url":"https://github.com/hgani","followers_url":"https://api.github.com/users/hgani/followers","following_url":"https://api.github.com/users/hgani/following{/other_user}","gists_url":"https://api.github.com/users/hgani/gists{/gist_id}","starred_url":"https://api.github.com/users/hgani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgani/subscriptions","organizations_url":"https://api.github.com/users/hgani/orgs","repos_url":"https://api.github.com/users/hgani/repos","events_url":"https://api.github.com/users/hgani/events{/privacy}","received_events_url":"https://api.github.com/users/hgani/received_events","type":"User","site_admin":false},"repo":{"id":73337497,"name":"judge","full_name":"hgani/judge","owner":{"login":"hgani","id":417160,"avatar_url":"https://avatars.githubusercontent.com/u/417160?v=3","gravatar_id":"","url":"https://api.github.com/users/hgani","html_url":"https://github.com/hgani","followers_url":"https://api.github.com/users/hgani/followers","following_url":"https://api.github.com/users/hgani/following{/other_user}","gists_url":"https://api.github.com/users/hgani/gists{/gist_id}","starred_url":"https://api.github.com/users/hgani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgani/subscriptions","organizations_url":"https://api.github.com/users/hgani/orgs","repos_url":"https://api.github.com/users/hgani/repos","events_url":"https://api.github.com/users/hgani/events{/privacy}","received_events_url":"https://api.github.com/users/hgani/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hgani/judge","description":"Client-side form validation for Rails","fork":true,"url":"https://api.github.com/repos/hgani/judge","forks_url":"https://api.github.com/repos/hgani/judge/forks","keys_url":"https://api.github.com/repos/hgani/judge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hgani/judge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hgani/judge/teams","hooks_url":"https://api.github.com/repos/hgani/judge/hooks","issue_events_url":"https://api.github.com/repos/hgani/judge/issues/events{/number}","events_url":"https://api.github.com/repos/hgani/judge/events","assignees_url":"https://api.github.com/repos/hgani/judge/assignees{/user}","branches_url":"https://api.github.com/repos/hgani/judge/branches{/branch}","tags_url":"https://api.github.com/repos/hgani/judge/tags","blobs_url":"https://api.github.com/repos/hgani/judge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hgani/judge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hgani/judge/git/refs{/sha}","trees_url":"https://api.github.com/repos/hgani/judge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hgani/judge/statuses/{sha}","languages_url":"https://api.github.com/repos/hgani/judge/languages","stargazers_url":"https://api.github.com/repos/hgani/judge/stargazers","contributors_url":"https://api.github.com/repos/hgani/judge/contributors","subscribers_url":"https://api.github.com/repos/hgani/judge/subscribers","subscription_url":"https://api.github.com/repos/hgani/judge/subscription","commits_url":"https://api.github.com/repos/hgani/judge/commits{/sha}","git_commits_url":"https://api.github.com/repos/hgani/judge/git/commits{/sha}","comments_url":"https://api.github.com/repos/hgani/judge/comments{/number}","issue_comment_url":"https://api.github.com/repos/hgani/judge/issues/comments{/number}","contents_url":"https://api.github.com/repos/hgani/judge/contents/{+path}","compare_url":"https://api.github.com/repos/hgani/judge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hgani/judge/merges","archive_url":"https://api.github.com/repos/hgani/judge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hgani/judge/downloads","issues_url":"https://api.github.com/repos/hgani/judge/issues{/number}","pulls_url":"https://api.github.com/repos/hgani/judge/pulls{/number}","milestones_url":"https://api.github.com/repos/hgani/judge/milestones{/number}","notifications_url":"https://api.github.com/repos/hgani/judge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hgani/judge/labels{/name}","releases_url":"https://api.github.com/repos/hgani/judge/releases{/id}","deployments_url":"https://api.github.com/repos/hgani/judge/deployments","created_at":"2016-11-10T01:49:31Z","updated_at":"2016-11-10T01:49:32Z","pushed_at":"2016-11-11T22:45:20Z","git_url":"git://github.com/hgani/judge.git","ssh_url":"git@github.com:hgani/judge.git","clone_url":"https://github.com/hgani/judge.git","svn_url":"https://github.com/hgani/judge","homepage":"","size":653,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"joecorcoran:master","ref":"master","sha":"b8b3cfd592d5704d8976ceabb5b991f41126a439","user":{"login":"joecorcoran","id":65193,"avatar_url":"https://avatars.githubusercontent.com/u/65193?v=3","gravatar_id":"","url":"https://api.github.com/users/joecorcoran","html_url":"https://github.com/joecorcoran","followers_url":"https://api.github.com/users/joecorcoran/followers","following_url":"https://api.github.com/users/joecorcoran/following{/other_user}","gists_url":"https://api.github.com/users/joecorcoran/gists{/gist_id}","starred_url":"https://api.github.com/users/joecorcoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joecorcoran/subscriptions","organizations_url":"https://api.github.com/users/joecorcoran/orgs","repos_url":"https://api.github.com/users/joecorcoran/repos","events_url":"https://api.github.com/users/joecorcoran/events{/privacy}","received_events_url":"https://api.github.com/users/joecorcoran/received_events","type":"User","site_admin":false},"repo":{"id":1450497,"name":"judge","full_name":"joecorcoran/judge","owner":{"login":"joecorcoran","id":65193,"avatar_url":"https://avatars.githubusercontent.com/u/65193?v=3","gravatar_id":"","url":"https://api.github.com/users/joecorcoran","html_url":"https://github.com/joecorcoran","followers_url":"https://api.github.com/users/joecorcoran/followers","following_url":"https://api.github.com/users/joecorcoran/following{/other_user}","gists_url":"https://api.github.com/users/joecorcoran/gists{/gist_id}","starred_url":"https://api.github.com/users/joecorcoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joecorcoran/subscriptions","organizations_url":"https://api.github.com/users/joecorcoran/orgs","repos_url":"https://api.github.com/users/joecorcoran/repos","events_url":"https://api.github.com/users/joecorcoran/events{/privacy}","received_events_url":"https://api.github.com/users/joecorcoran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joecorcoran/judge","description":"Client-side form validation for Rails","fork":false,"url":"https://api.github.com/repos/joecorcoran/judge","forks_url":"https://api.github.com/repos/joecorcoran/judge/forks","keys_url":"https://api.github.com/repos/joecorcoran/judge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joecorcoran/judge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joecorcoran/judge/teams","hooks_url":"https://api.github.com/repos/joecorcoran/judge/hooks","issue_events_url":"https://api.github.com/repos/joecorcoran/judge/issues/events{/number}","events_url":"https://api.github.com/repos/joecorcoran/judge/events","assignees_url":"https://api.github.com/repos/joecorcoran/judge/assignees{/user}","branches_url":"https://api.github.com/repos/joecorcoran/judge/branches{/branch}","tags_url":"https://api.github.com/repos/joecorcoran/judge/tags","blobs_url":"https://api.github.com/repos/joecorcoran/judge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joecorcoran/judge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joecorcoran/judge/git/refs{/sha}","trees_url":"https://api.github.com/repos/joecorcoran/judge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joecorcoran/judge/statuses/{sha}","languages_url":"https://api.github.com/repos/joecorcoran/judge/languages","stargazers_url":"https://api.github.com/repos/joecorcoran/judge/stargazers","contributors_url":"https://api.github.com/repos/joecorcoran/judge/contributors","subscribers_url":"https://api.github.com/repos/joecorcoran/judge/subscribers","subscription_url":"https://api.github.com/repos/joecorcoran/judge/subscription","commits_url":"https://api.github.com/repos/joecorcoran/judge/commits{/sha}","git_commits_url":"https://api.github.com/repos/joecorcoran/judge/git/commits{/sha}","comments_url":"https://api.github.com/repos/joecorcoran/judge/comments{/number}","issue_comment_url":"https://api.github.com/repos/joecorcoran/judge/issues/comments{/number}","contents_url":"https://api.github.com/repos/joecorcoran/judge/contents/{+path}","compare_url":"https://api.github.com/repos/joecorcoran/judge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joecorcoran/judge/merges","archive_url":"https://api.github.com/repos/joecorcoran/judge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joecorcoran/judge/downloads","issues_url":"https://api.github.com/repos/joecorcoran/judge/issues{/number}","pulls_url":"https://api.github.com/repos/joecorcoran/judge/pulls{/number}","milestones_url":"https://api.github.com/repos/joecorcoran/judge/milestones{/number}","notifications_url":"https://api.github.com/repos/joecorcoran/judge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joecorcoran/judge/labels{/name}","releases_url":"https://api.github.com/repos/joecorcoran/judge/releases{/id}","deployments_url":"https://api.github.com/repos/joecorcoran/judge/deployments","created_at":"2011-03-07T15:12:55Z","updated_at":"2016-09-29T15:52:55Z","pushed_at":"2016-11-11T22:45:21Z","git_url":"git://github.com/joecorcoran/judge.git","ssh_url":"git@github.com:joecorcoran/judge.git","clone_url":"https://github.com/joecorcoran/judge.git","svn_url":"https://github.com/joecorcoran/judge","homepage":"","size":768,"stargazers_count":227,"watchers_count":227,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":7,"forks":35,"open_issues":7,"watchers":227,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/joecorcoran/judge/pulls/78"},"html":{"href":"https://github.com/joecorcoran/judge/pull/78"},"issue":{"href":"https://api.github.com/repos/joecorcoran/judge/issues/78"},"comments":{"href":"https://api.github.com/repos/joecorcoran/judge/issues/78/comments"},"review_comments":{"href":"https://api.github.com/repos/joecorcoran/judge/pulls/78/comments"},"review_comment":{"href":"https://api.github.com/repos/joecorcoran/judge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joecorcoran/judge/pulls/78/commits"},"statuses":{"href":"https://api.github.com/repos/joecorcoran/judge/statuses/f88c1e5f30175fae1b031f81f7009045450c3875"}}}}
{"actor":{"display_login":"jamesmk"}}