{"action":"created","comment":{"url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/comments/33712544","id":33712544,"diff_hunk":"@@ -39,11 +39,15 @@ def has_scopes?\n     end\n \n     def generate_uid\n-      self.uid ||= UniqueToken.generate\n+      if self.uid.blank?","path":"lib/doorkeeper/models/application_mixin.rb","position":5,"original_position":5,"commit_id":"64a0f001cb961b55c526b91be2fe8674d272c37a","original_commit_id":"64a0f001cb961b55c526b91be2fe8674d272c37a","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":"Redundant `self` detected.","created_at":"2015-07-01T19:03:30Z","updated_at":"2015-07-01T19:03:30Z","html_url":"https://github.com/doorkeeper-gem/doorkeeper/pull/683#discussion_r33712544","pull_request_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/683","_links":{"self":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/comments/33712544"},"html":{"href":"https://github.com/doorkeeper-gem/doorkeeper/pull/683#discussion_r33712544"},"pull_request":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/683"}}},"pull_request":{"url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/683","id":39014341,"html_url":"https://github.com/doorkeeper-gem/doorkeeper/pull/683","diff_url":"https://github.com/doorkeeper-gem/doorkeeper/pull/683.diff","patch_url":"https://github.com/doorkeeper-gem/doorkeeper/pull/683.patch","issue_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/683","number":683,"state":"open","locked":false,"title":"Application UID/Secret generation should happen for blank fields","user":{"login":"harrisj","id":2044,"avatar_url":"https://avatars.githubusercontent.com/u/2044?v=3","gravatar_id":"","url":"https://api.github.com/users/harrisj","html_url":"https://github.com/harrisj","followers_url":"https://api.github.com/users/harrisj/followers","following_url":"https://api.github.com/users/harrisj/following{/other_user}","gists_url":"https://api.github.com/users/harrisj/gists{/gist_id}","starred_url":"https://api.github.com/users/harrisj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrisj/subscriptions","organizations_url":"https://api.github.com/users/harrisj/orgs","repos_url":"https://api.github.com/users/harrisj/repos","events_url":"https://api.github.com/users/harrisj/events{/privacy}","received_events_url":"https://api.github.com/users/harrisj/received_events","type":"User","site_admin":false},"body":"We are using Doorkeeper in a project, and there was a strange issue where the `oauth_applications` table's schema was somehow set to use the empty string as defaults for the `secret` and `uid` tables. (see [this pull request for MyUSA for details on the problem](https://github.com/18F/myusa/pull/684)). This would then make it impossible to create new applications because the blank string would not trigger the `generate_secret` and `generate_uid` before_create callbacks, but they would cause Rails to throw an exception for violating the `validates :presence` restriction on those fields.\r\n\r\nWhile this ultimately turned out to be an issue with our DB schema and not with Doorkeeper, I feel like it would be good to modify this callback code for creates to also get triggered if the UID and Secret fields are blank strings, just because it turned out to be a difficult problem to find and resolve. So, I'm submitting a pull request back to you in case you agree. Thank you.","created_at":"2015-07-01T19:03:21Z","updated_at":"2015-07-01T19:03:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19166fd7d79ab27d34a59a3a356bef31f0d9e2e0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/683/commits","review_comments_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/683/comments","review_comment_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/683/comments","statuses_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/statuses/64a0f001cb961b55c526b91be2fe8674d272c37a","head":{"label":"harrisj:master","ref":"master","sha":"64a0f001cb961b55c526b91be2fe8674d272c37a","user":{"login":"harrisj","id":2044,"avatar_url":"https://avatars.githubusercontent.com/u/2044?v=3","gravatar_id":"","url":"https://api.github.com/users/harrisj","html_url":"https://github.com/harrisj","followers_url":"https://api.github.com/users/harrisj/followers","following_url":"https://api.github.com/users/harrisj/following{/other_user}","gists_url":"https://api.github.com/users/harrisj/gists{/gist_id}","starred_url":"https://api.github.com/users/harrisj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrisj/subscriptions","organizations_url":"https://api.github.com/users/harrisj/orgs","repos_url":"https://api.github.com/users/harrisj/repos","events_url":"https://api.github.com/users/harrisj/events{/privacy}","received_events_url":"https://api.github.com/users/harrisj/received_events","type":"User","site_admin":false},"repo":{"id":38325808,"name":"doorkeeper","full_name":"harrisj/doorkeeper","owner":{"login":"harrisj","id":2044,"avatar_url":"https://avatars.githubusercontent.com/u/2044?v=3","gravatar_id":"","url":"https://api.github.com/users/harrisj","html_url":"https://github.com/harrisj","followers_url":"https://api.github.com/users/harrisj/followers","following_url":"https://api.github.com/users/harrisj/following{/other_user}","gists_url":"https://api.github.com/users/harrisj/gists{/gist_id}","starred_url":"https://api.github.com/users/harrisj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrisj/subscriptions","organizations_url":"https://api.github.com/users/harrisj/orgs","repos_url":"https://api.github.com/users/harrisj/repos","events_url":"https://api.github.com/users/harrisj/events{/privacy}","received_events_url":"https://api.github.com/users/harrisj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/harrisj/doorkeeper","description":"Doorkeeper is an OAuth 2 provider for Rails and Grape","fork":true,"url":"https://api.github.com/repos/harrisj/doorkeeper","forks_url":"https://api.github.com/repos/harrisj/doorkeeper/forks","keys_url":"https://api.github.com/repos/harrisj/doorkeeper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harrisj/doorkeeper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harrisj/doorkeeper/teams","hooks_url":"https://api.github.com/repos/harrisj/doorkeeper/hooks","issue_events_url":"https://api.github.com/repos/harrisj/doorkeeper/issues/events{/number}","events_url":"https://api.github.com/repos/harrisj/doorkeeper/events","assignees_url":"https://api.github.com/repos/harrisj/doorkeeper/assignees{/user}","branches_url":"https://api.github.com/repos/harrisj/doorkeeper/branches{/branch}","tags_url":"https://api.github.com/repos/harrisj/doorkeeper/tags","blobs_url":"https://api.github.com/repos/harrisj/doorkeeper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harrisj/doorkeeper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harrisj/doorkeeper/git/refs{/sha}","trees_url":"https://api.github.com/repos/harrisj/doorkeeper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harrisj/doorkeeper/statuses/{sha}","languages_url":"https://api.github.com/repos/harrisj/doorkeeper/languages","stargazers_url":"https://api.github.com/repos/harrisj/doorkeeper/stargazers","contributors_url":"https://api.github.com/repos/harrisj/doorkeeper/contributors","subscribers_url":"https://api.github.com/repos/harrisj/doorkeeper/subscribers","subscription_url":"https://api.github.com/repos/harrisj/doorkeeper/subscription","commits_url":"https://api.github.com/repos/harrisj/doorkeeper/commits{/sha}","git_commits_url":"https://api.github.com/repos/harrisj/doorkeeper/git/commits{/sha}","comments_url":"https://api.github.com/repos/harrisj/doorkeeper/comments{/number}","issue_comment_url":"https://api.github.com/repos/harrisj/doorkeeper/issues/comments{/number}","contents_url":"https://api.github.com/repos/harrisj/doorkeeper/contents/{+path}","compare_url":"https://api.github.com/repos/harrisj/doorkeeper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harrisj/doorkeeper/merges","archive_url":"https://api.github.com/repos/harrisj/doorkeeper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harrisj/doorkeeper/downloads","issues_url":"https://api.github.com/repos/harrisj/doorkeeper/issues{/number}","pulls_url":"https://api.github.com/repos/harrisj/doorkeeper/pulls{/number}","milestones_url":"https://api.github.com/repos/harrisj/doorkeeper/milestones{/number}","notifications_url":"https://api.github.com/repos/harrisj/doorkeeper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harrisj/doorkeeper/labels{/name}","releases_url":"https://api.github.com/repos/harrisj/doorkeeper/releases{/id}","created_at":"2015-06-30T18:24:05Z","updated_at":"2015-06-30T18:24:07Z","pushed_at":"2015-07-01T18:55:12Z","git_url":"git://github.com/harrisj/doorkeeper.git","ssh_url":"git@github.com:harrisj/doorkeeper.git","clone_url":"https://github.com/harrisj/doorkeeper.git","svn_url":"https://github.com/harrisj/doorkeeper","homepage":"","size":5133,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"doorkeeper-gem:master","ref":"master","sha":"7e9bc8e84718709050a33316617ec852fee175c8","user":{"login":"doorkeeper-gem","id":7275750,"avatar_url":"https://avatars.githubusercontent.com/u/7275750?v=3","gravatar_id":"","url":"https://api.github.com/users/doorkeeper-gem","html_url":"https://github.com/doorkeeper-gem","followers_url":"https://api.github.com/users/doorkeeper-gem/followers","following_url":"https://api.github.com/users/doorkeeper-gem/following{/other_user}","gists_url":"https://api.github.com/users/doorkeeper-gem/gists{/gist_id}","starred_url":"https://api.github.com/users/doorkeeper-gem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doorkeeper-gem/subscriptions","organizations_url":"https://api.github.com/users/doorkeeper-gem/orgs","repos_url":"https://api.github.com/users/doorkeeper-gem/repos","events_url":"https://api.github.com/users/doorkeeper-gem/events{/privacy}","received_events_url":"https://api.github.com/users/doorkeeper-gem/received_events","type":"Organization","site_admin":false},"repo":{"id":2802565,"name":"doorkeeper","full_name":"doorkeeper-gem/doorkeeper","owner":{"login":"doorkeeper-gem","id":7275750,"avatar_url":"https://avatars.githubusercontent.com/u/7275750?v=3","gravatar_id":"","url":"https://api.github.com/users/doorkeeper-gem","html_url":"https://github.com/doorkeeper-gem","followers_url":"https://api.github.com/users/doorkeeper-gem/followers","following_url":"https://api.github.com/users/doorkeeper-gem/following{/other_user}","gists_url":"https://api.github.com/users/doorkeeper-gem/gists{/gist_id}","starred_url":"https://api.github.com/users/doorkeeper-gem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doorkeeper-gem/subscriptions","organizations_url":"https://api.github.com/users/doorkeeper-gem/orgs","repos_url":"https://api.github.com/users/doorkeeper-gem/repos","events_url":"https://api.github.com/users/doorkeeper-gem/events{/privacy}","received_events_url":"https://api.github.com/users/doorkeeper-gem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/doorkeeper-gem/doorkeeper","description":"Doorkeeper is an OAuth 2 provider for Rails and Grape","fork":false,"url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper","forks_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/forks","keys_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/teams","hooks_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/hooks","issue_events_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/events{/number}","events_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/events","assignees_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/assignees{/user}","branches_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/branches{/branch}","tags_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/tags","blobs_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/git/refs{/sha}","trees_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/statuses/{sha}","languages_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/languages","stargazers_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/stargazers","contributors_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/contributors","subscribers_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/subscribers","subscription_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/subscription","commits_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/commits{/sha}","git_commits_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/git/commits{/sha}","comments_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/comments{/number}","issue_comment_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/comments{/number}","contents_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/contents/{+path}","compare_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/merges","archive_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/downloads","issues_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues{/number}","pulls_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls{/number}","milestones_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/milestones{/number}","notifications_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/labels{/name}","releases_url":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/releases{/id}","created_at":"2011-11-18T13:02:01Z","updated_at":"2015-06-30T23:59:35Z","pushed_at":"2015-07-01T19:03:23Z","git_url":"git://github.com/doorkeeper-gem/doorkeeper.git","ssh_url":"git@github.com:doorkeeper-gem/doorkeeper.git","clone_url":"https://github.com/doorkeeper-gem/doorkeeper.git","svn_url":"https://github.com/doorkeeper-gem/doorkeeper","homepage":"","size":5133,"stargazers_count":2417,"watchers_count":2417,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":497,"mirror_url":null,"open_issues_count":16,"forks":497,"open_issues":16,"watchers":2417,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/683"},"html":{"href":"https://github.com/doorkeeper-gem/doorkeeper/pull/683"},"issue":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/683"},"comments":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/issues/683/comments"},"review_comments":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/683/comments"},"review_comment":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/pulls/683/commits"},"statuses":{"href":"https://api.github.com/repos/doorkeeper-gem/doorkeeper/statuses/64a0f001cb961b55c526b91be2fe8674d272c37a"}}}}