{"action":"created","comment":{"url":"https://api.github.com/repos/rails/globalid/pulls/comments/29919473","id":29919473,"diff_hunk":"@@ -154,6 +157,13 @@ def validate_component(component)\n           \"Expected a URI like gid://app/Person/1234: #{inspect}\"\n       end\n \n+      def validate_model_id(model_id)\n+        return model_id unless model_id.blank?\n+\n+        raise MissingModelId, \"Unable to create a global id for #{model_name} \" \\","path":"lib/global_id/uri/gid.rb","position":26,"original_position":26,"commit_id":"f31ef3f521b65348f107380392e2ce0141c733e5","original_commit_id":"f31ef3f521b65348f107380392e2ce0141c733e5","user":{"login":"kaspth","id":350807,"avatar_url":"https://avatars.githubusercontent.com/u/350807?v=3","gravatar_id":"","url":"https://api.github.com/users/kaspth","html_url":"https://github.com/kaspth","followers_url":"https://api.github.com/users/kaspth/followers","following_url":"https://api.github.com/users/kaspth/following{/other_user}","gists_url":"https://api.github.com/users/kaspth/gists{/gist_id}","starred_url":"https://api.github.com/users/kaspth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaspth/subscriptions","organizations_url":"https://api.github.com/users/kaspth/orgs","repos_url":"https://api.github.com/users/kaspth/repos","events_url":"https://api.github.com/users/kaspth/events{/privacy}","received_events_url":"https://api.github.com/users/kaspth/received_events","type":"User","site_admin":false},"body":"model_name will be nil here. Inject model_name as a second parameter and upgrade the post fix if on line 147 to a standard if with the validations on separate lines.","created_at":"2015-05-08T06:37:32Z","updated_at":"2015-05-08T06:37:32Z","html_url":"https://github.com/rails/globalid/pull/68#discussion_r29919473","pull_request_url":"https://api.github.com/repos/rails/globalid/pulls/68","_links":{"self":{"href":"https://api.github.com/repos/rails/globalid/pulls/comments/29919473"},"html":{"href":"https://github.com/rails/globalid/pull/68#discussion_r29919473"},"pull_request":{"href":"https://api.github.com/repos/rails/globalid/pulls/68"}}},"pull_request":{"url":"https://api.github.com/repos/rails/globalid/pulls/68","id":34115837,"html_url":"https://github.com/rails/globalid/pull/68","diff_url":"https://github.com/rails/globalid/pull/68.diff","patch_url":"https://github.com/rails/globalid/pull/68.patch","issue_url":"https://api.github.com/repos/rails/globalid/issues/68","number":68,"state":"open","locked":false,"title":"Raise a BlankIdError when converting an object without an id","user":{"login":"fny","id":346068,"avatar_url":"https://avatars.githubusercontent.com/u/346068?v=3","gravatar_id":"","url":"https://api.github.com/users/fny","html_url":"https://github.com/fny","followers_url":"https://api.github.com/users/fny/followers","following_url":"https://api.github.com/users/fny/following{/other_user}","gists_url":"https://api.github.com/users/fny/gists{/gist_id}","starred_url":"https://api.github.com/users/fny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fny/subscriptions","organizations_url":"https://api.github.com/users/fny/orgs","repos_url":"https://api.github.com/users/fny/repos","events_url":"https://api.github.com/users/fny/events{/privacy}","received_events_url":"https://api.github.com/users/fny/received_events","type":"User","site_admin":false},"body":"Not sure if `UnidentifiedObject` is the best name? Perhaps `BlankId`?","created_at":"2015-04-26T00:57:12Z","updated_at":"2015-05-08T06:37:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f52959096707d64d9178bb91fd71ae1cc6a99b1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails/globalid/pulls/68/commits","review_comments_url":"https://api.github.com/repos/rails/globalid/pulls/68/comments","review_comment_url":"https://api.github.com/repos/rails/globalid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/globalid/issues/68/comments","statuses_url":"https://api.github.com/repos/rails/globalid/statuses/f31ef3f521b65348f107380392e2ce0141c733e5","head":{"label":"fny:improve-blank-id-error","ref":"improve-blank-id-error","sha":"f31ef3f521b65348f107380392e2ce0141c733e5","user":{"login":"fny","id":346068,"avatar_url":"https://avatars.githubusercontent.com/u/346068?v=3","gravatar_id":"","url":"https://api.github.com/users/fny","html_url":"https://github.com/fny","followers_url":"https://api.github.com/users/fny/followers","following_url":"https://api.github.com/users/fny/following{/other_user}","gists_url":"https://api.github.com/users/fny/gists{/gist_id}","starred_url":"https://api.github.com/users/fny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fny/subscriptions","organizations_url":"https://api.github.com/users/fny/orgs","repos_url":"https://api.github.com/users/fny/repos","events_url":"https://api.github.com/users/fny/events{/privacy}","received_events_url":"https://api.github.com/users/fny/received_events","type":"User","site_admin":false},"repo":{"id":34592127,"name":"globalid","full_name":"fny/globalid","owner":{"login":"fny","id":346068,"avatar_url":"https://avatars.githubusercontent.com/u/346068?v=3","gravatar_id":"","url":"https://api.github.com/users/fny","html_url":"https://github.com/fny","followers_url":"https://api.github.com/users/fny/followers","following_url":"https://api.github.com/users/fny/following{/other_user}","gists_url":"https://api.github.com/users/fny/gists{/gist_id}","starred_url":"https://api.github.com/users/fny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fny/subscriptions","organizations_url":"https://api.github.com/users/fny/orgs","repos_url":"https://api.github.com/users/fny/repos","events_url":"https://api.github.com/users/fny/events{/privacy}","received_events_url":"https://api.github.com/users/fny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fny/globalid","description":"Identify app models with a URI","fork":true,"url":"https://api.github.com/repos/fny/globalid","forks_url":"https://api.github.com/repos/fny/globalid/forks","keys_url":"https://api.github.com/repos/fny/globalid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fny/globalid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fny/globalid/teams","hooks_url":"https://api.github.com/repos/fny/globalid/hooks","issue_events_url":"https://api.github.com/repos/fny/globalid/issues/events{/number}","events_url":"https://api.github.com/repos/fny/globalid/events","assignees_url":"https://api.github.com/repos/fny/globalid/assignees{/user}","branches_url":"https://api.github.com/repos/fny/globalid/branches{/branch}","tags_url":"https://api.github.com/repos/fny/globalid/tags","blobs_url":"https://api.github.com/repos/fny/globalid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fny/globalid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fny/globalid/git/refs{/sha}","trees_url":"https://api.github.com/repos/fny/globalid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fny/globalid/statuses/{sha}","languages_url":"https://api.github.com/repos/fny/globalid/languages","stargazers_url":"https://api.github.com/repos/fny/globalid/stargazers","contributors_url":"https://api.github.com/repos/fny/globalid/contributors","subscribers_url":"https://api.github.com/repos/fny/globalid/subscribers","subscription_url":"https://api.github.com/repos/fny/globalid/subscription","commits_url":"https://api.github.com/repos/fny/globalid/commits{/sha}","git_commits_url":"https://api.github.com/repos/fny/globalid/git/commits{/sha}","comments_url":"https://api.github.com/repos/fny/globalid/comments{/number}","issue_comment_url":"https://api.github.com/repos/fny/globalid/issues/comments{/number}","contents_url":"https://api.github.com/repos/fny/globalid/contents/{+path}","compare_url":"https://api.github.com/repos/fny/globalid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fny/globalid/merges","archive_url":"https://api.github.com/repos/fny/globalid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fny/globalid/downloads","issues_url":"https://api.github.com/repos/fny/globalid/issues{/number}","pulls_url":"https://api.github.com/repos/fny/globalid/pulls{/number}","milestones_url":"https://api.github.com/repos/fny/globalid/milestones{/number}","notifications_url":"https://api.github.com/repos/fny/globalid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fny/globalid/labels{/name}","releases_url":"https://api.github.com/repos/fny/globalid/releases{/id}","created_at":"2015-04-26T00:44:34Z","updated_at":"2015-04-26T00:44:34Z","pushed_at":"2015-05-07T20:48:46Z","git_url":"git://github.com/fny/globalid.git","ssh_url":"git@github.com:fny/globalid.git","clone_url":"https://github.com/fny/globalid.git","svn_url":"https://github.com/fny/globalid","homepage":null,"size":211,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"rails:master","ref":"master","sha":"ab7d216c6e71d1036feda2fdf0193255cc91b0a6","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":22991474,"name":"globalid","full_name":"rails/globalid","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/globalid","description":"Identify app models with a URI","fork":false,"url":"https://api.github.com/repos/rails/globalid","forks_url":"https://api.github.com/repos/rails/globalid/forks","keys_url":"https://api.github.com/repos/rails/globalid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/globalid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/globalid/teams","hooks_url":"https://api.github.com/repos/rails/globalid/hooks","issue_events_url":"https://api.github.com/repos/rails/globalid/issues/events{/number}","events_url":"https://api.github.com/repos/rails/globalid/events","assignees_url":"https://api.github.com/repos/rails/globalid/assignees{/user}","branches_url":"https://api.github.com/repos/rails/globalid/branches{/branch}","tags_url":"https://api.github.com/repos/rails/globalid/tags","blobs_url":"https://api.github.com/repos/rails/globalid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/globalid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/globalid/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/globalid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/globalid/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/globalid/languages","stargazers_url":"https://api.github.com/repos/rails/globalid/stargazers","contributors_url":"https://api.github.com/repos/rails/globalid/contributors","subscribers_url":"https://api.github.com/repos/rails/globalid/subscribers","subscription_url":"https://api.github.com/repos/rails/globalid/subscription","commits_url":"https://api.github.com/repos/rails/globalid/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/globalid/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/globalid/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/globalid/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/globalid/contents/{+path}","compare_url":"https://api.github.com/repos/rails/globalid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/globalid/merges","archive_url":"https://api.github.com/repos/rails/globalid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/globalid/downloads","issues_url":"https://api.github.com/repos/rails/globalid/issues{/number}","pulls_url":"https://api.github.com/repos/rails/globalid/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/globalid/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/globalid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/globalid/labels{/name}","releases_url":"https://api.github.com/repos/rails/globalid/releases{/id}","created_at":"2014-08-15T14:05:35Z","updated_at":"2015-05-05T20:39:42Z","pushed_at":"2015-05-07T20:48:47Z","git_url":"git://github.com/rails/globalid.git","ssh_url":"git@github.com:rails/globalid.git","clone_url":"https://github.com/rails/globalid.git","svn_url":"https://github.com/rails/globalid","homepage":null,"size":939,"stargazers_count":385,"watchers_count":385,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":4,"forks":51,"open_issues":4,"watchers":385,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/globalid/pulls/68"},"html":{"href":"https://github.com/rails/globalid/pull/68"},"issue":{"href":"https://api.github.com/repos/rails/globalid/issues/68"},"comments":{"href":"https://api.github.com/repos/rails/globalid/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/globalid/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/globalid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/globalid/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/rails/globalid/statuses/f31ef3f521b65348f107380392e2ce0141c733e5"}}}}