{"action":"created","comment":{"url":"https://api.github.com/repos/briankung/projectcredo/pulls/comments/78482717","id":78482717,"diff_hunk":"@@ -4,10 +4,40 @@ class User < ApplicationRecord\n   devise :database_authenticatable, :registerable,\n          :recoverable, :rememberable, :trackable, :validatable\n \n+  # Virtual attribute for authenticating by either username or email\n+  # This is in addition to a real persisted field like 'username'\n+  attr_accessor :login\n+\n+  validates_format_of :username, with: /^[a-zA-Z0-9_\\.]*$/, :multiline => true\n+  validates :username,\n+  :presence => true,\n+  :uniqueness => {\n+    :case_sensitive => false\n+  }","path":"app/models/user.rb","position":13,"original_position":13,"commit_id":"bd9ccc1d5188018f4e9ce2f8322e79ce47719f79","original_commit_id":"bd9ccc1d5188018f4e9ce2f8322e79ce47719f79","user":{"login":"briankung","id":2836167,"avatar_url":"https://avatars.githubusercontent.com/u/2836167?v=3","gravatar_id":"","url":"https://api.github.com/users/briankung","html_url":"https://github.com/briankung","followers_url":"https://api.github.com/users/briankung/followers","following_url":"https://api.github.com/users/briankung/following{/other_user}","gists_url":"https://api.github.com/users/briankung/gists{/gist_id}","starred_url":"https://api.github.com/users/briankung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briankung/subscriptions","organizations_url":"https://api.github.com/users/briankung/orgs","repos_url":"https://api.github.com/users/briankung/repos","events_url":"https://api.github.com/users/briankung/events{/privacy}","received_events_url":"https://api.github.com/users/briankung/received_events","type":"User","site_admin":false},"body":"So `presence: true` and the likes","created_at":"2016-09-13T01:15:19Z","updated_at":"2016-09-13T01:15:19Z","html_url":"https://github.com/briankung/projectcredo/pull/76#discussion_r78482717","pull_request_url":"https://api.github.com/repos/briankung/projectcredo/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/briankung/projectcredo/pulls/comments/78482717"},"html":{"href":"https://github.com/briankung/projectcredo/pull/76#discussion_r78482717"},"pull_request":{"href":"https://api.github.com/repos/briankung/projectcredo/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/briankung/projectcredo/pulls/76","id":84969426,"html_url":"https://github.com/briankung/projectcredo/pull/76","diff_url":"https://github.com/briankung/projectcredo/pull/76.diff","patch_url":"https://github.com/briankung/projectcredo/pull/76.patch","issue_url":"https://api.github.com/repos/briankung/projectcredo/issues/76","number":76,"state":"open","locked":false,"title":"Add usernames","user":{"login":"wsf246","id":2272356,"avatar_url":"https://avatars.githubusercontent.com/u/2272356?v=3","gravatar_id":"","url":"https://api.github.com/users/wsf246","html_url":"https://github.com/wsf246","followers_url":"https://api.github.com/users/wsf246/followers","following_url":"https://api.github.com/users/wsf246/following{/other_user}","gists_url":"https://api.github.com/users/wsf246/gists{/gist_id}","starred_url":"https://api.github.com/users/wsf246/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wsf246/subscriptions","organizations_url":"https://api.github.com/users/wsf246/orgs","repos_url":"https://api.github.com/users/wsf246/repos","events_url":"https://api.github.com/users/wsf246/events{/privacy}","received_events_url":"https://api.github.com/users/wsf246/received_events","type":"User","site_admin":false},"body":"I'm going to do some quick formatting w/ bootstrap form stuff for the devise views, but other than that it seems to work.  I'm like 85% lucid of what this code is doing and i used this tutorial:\r\nhttps://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address\r\n\r\nHopefully I didn't break anything.","created_at":"2016-09-13T00:52:39Z","updated_at":"2016-09-13T01:15:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f123e1afc94e6efa2da2bf7cf35989e90c9489a3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/briankung/projectcredo/pulls/76/commits","review_comments_url":"https://api.github.com/repos/briankung/projectcredo/pulls/76/comments","review_comment_url":"https://api.github.com/repos/briankung/projectcredo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/briankung/projectcredo/issues/76/comments","statuses_url":"https://api.github.com/repos/briankung/projectcredo/statuses/bd9ccc1d5188018f4e9ce2f8322e79ce47719f79","head":{"label":"briankung:addUsernames","ref":"addUsernames","sha":"bd9ccc1d5188018f4e9ce2f8322e79ce47719f79","user":{"login":"briankung","id":2836167,"avatar_url":"https://avatars.githubusercontent.com/u/2836167?v=3","gravatar_id":"","url":"https://api.github.com/users/briankung","html_url":"https://github.com/briankung","followers_url":"https://api.github.com/users/briankung/followers","following_url":"https://api.github.com/users/briankung/following{/other_user}","gists_url":"https://api.github.com/users/briankung/gists{/gist_id}","starred_url":"https://api.github.com/users/briankung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briankung/subscriptions","organizations_url":"https://api.github.com/users/briankung/orgs","repos_url":"https://api.github.com/users/briankung/repos","events_url":"https://api.github.com/users/briankung/events{/privacy}","received_events_url":"https://api.github.com/users/briankung/received_events","type":"User","site_admin":false},"repo":{"id":61582608,"name":"projectcredo","full_name":"briankung/projectcredo","owner":{"login":"briankung","id":2836167,"avatar_url":"https://avatars.githubusercontent.com/u/2836167?v=3","gravatar_id":"","url":"https://api.github.com/users/briankung","html_url":"https://github.com/briankung","followers_url":"https://api.github.com/users/briankung/followers","following_url":"https://api.github.com/users/briankung/following{/other_user}","gists_url":"https://api.github.com/users/briankung/gists{/gist_id}","starred_url":"https://api.github.com/users/briankung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briankung/subscriptions","organizations_url":"https://api.github.com/users/briankung/orgs","repos_url":"https://api.github.com/users/briankung/repos","events_url":"https://api.github.com/users/briankung/events{/privacy}","received_events_url":"https://api.github.com/users/briankung/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/briankung/projectcredo","description":"Project Credo v2","fork":false,"url":"https://api.github.com/repos/briankung/projectcredo","forks_url":"https://api.github.com/repos/briankung/projectcredo/forks","keys_url":"https://api.github.com/repos/briankung/projectcredo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/briankung/projectcredo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/briankung/projectcredo/teams","hooks_url":"https://api.github.com/repos/briankung/projectcredo/hooks","issue_events_url":"https://api.github.com/repos/briankung/projectcredo/issues/events{/number}","events_url":"https://api.github.com/repos/briankung/projectcredo/events","assignees_url":"https://api.github.com/repos/briankung/projectcredo/assignees{/user}","branches_url":"https://api.github.com/repos/briankung/projectcredo/branches{/branch}","tags_url":"https://api.github.com/repos/briankung/projectcredo/tags","blobs_url":"https://api.github.com/repos/briankung/projectcredo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/briankung/projectcredo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/briankung/projectcredo/git/refs{/sha}","trees_url":"https://api.github.com/repos/briankung/projectcredo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/briankung/projectcredo/statuses/{sha}","languages_url":"https://api.github.com/repos/briankung/projectcredo/languages","stargazers_url":"https://api.github.com/repos/briankung/projectcredo/stargazers","contributors_url":"https://api.github.com/repos/briankung/projectcredo/contributors","subscribers_url":"https://api.github.com/repos/briankung/projectcredo/subscribers","subscription_url":"https://api.github.com/repos/briankung/projectcredo/subscription","commits_url":"https://api.github.com/repos/briankung/projectcredo/commits{/sha}","git_commits_url":"https://api.github.com/repos/briankung/projectcredo/git/commits{/sha}","comments_url":"https://api.github.com/repos/briankung/projectcredo/comments{/number}","issue_comment_url":"https://api.github.com/repos/briankung/projectcredo/issues/comments{/number}","contents_url":"https://api.github.com/repos/briankung/projectcredo/contents/{+path}","compare_url":"https://api.github.com/repos/briankung/projectcredo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/briankung/projectcredo/merges","archive_url":"https://api.github.com/repos/briankung/projectcredo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/briankung/projectcredo/downloads","issues_url":"https://api.github.com/repos/briankung/projectcredo/issues{/number}","pulls_url":"https://api.github.com/repos/briankung/projectcredo/pulls{/number}","milestones_url":"https://api.github.com/repos/briankung/projectcredo/milestones{/number}","notifications_url":"https://api.github.com/repos/briankung/projectcredo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/briankung/projectcredo/labels{/name}","releases_url":"https://api.github.com/repos/briankung/projectcredo/releases{/id}","deployments_url":"https://api.github.com/repos/briankung/projectcredo/deployments","created_at":"2016-06-20T21:47:57Z","updated_at":"2016-06-20T21:48:15Z","pushed_at":"2016-09-13T00:52:40Z","git_url":"git://github.com/briankung/projectcredo.git","ssh_url":"git@github.com:briankung/projectcredo.git","clone_url":"https://github.com/briankung/projectcredo.git","svn_url":"https://github.com/briankung/projectcredo","homepage":null,"size":244,"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":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"base":{"label":"briankung:master","ref":"master","sha":"0a98c5abd0cec6cb0ab6db55ad56e52c50f7f1b4","user":{"login":"briankung","id":2836167,"avatar_url":"https://avatars.githubusercontent.com/u/2836167?v=3","gravatar_id":"","url":"https://api.github.com/users/briankung","html_url":"https://github.com/briankung","followers_url":"https://api.github.com/users/briankung/followers","following_url":"https://api.github.com/users/briankung/following{/other_user}","gists_url":"https://api.github.com/users/briankung/gists{/gist_id}","starred_url":"https://api.github.com/users/briankung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briankung/subscriptions","organizations_url":"https://api.github.com/users/briankung/orgs","repos_url":"https://api.github.com/users/briankung/repos","events_url":"https://api.github.com/users/briankung/events{/privacy}","received_events_url":"https://api.github.com/users/briankung/received_events","type":"User","site_admin":false},"repo":{"id":61582608,"name":"projectcredo","full_name":"briankung/projectcredo","owner":{"login":"briankung","id":2836167,"avatar_url":"https://avatars.githubusercontent.com/u/2836167?v=3","gravatar_id":"","url":"https://api.github.com/users/briankung","html_url":"https://github.com/briankung","followers_url":"https://api.github.com/users/briankung/followers","following_url":"https://api.github.com/users/briankung/following{/other_user}","gists_url":"https://api.github.com/users/briankung/gists{/gist_id}","starred_url":"https://api.github.com/users/briankung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briankung/subscriptions","organizations_url":"https://api.github.com/users/briankung/orgs","repos_url":"https://api.github.com/users/briankung/repos","events_url":"https://api.github.com/users/briankung/events{/privacy}","received_events_url":"https://api.github.com/users/briankung/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/briankung/projectcredo","description":"Project Credo v2","fork":false,"url":"https://api.github.com/repos/briankung/projectcredo","forks_url":"https://api.github.com/repos/briankung/projectcredo/forks","keys_url":"https://api.github.com/repos/briankung/projectcredo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/briankung/projectcredo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/briankung/projectcredo/teams","hooks_url":"https://api.github.com/repos/briankung/projectcredo/hooks","issue_events_url":"https://api.github.com/repos/briankung/projectcredo/issues/events{/number}","events_url":"https://api.github.com/repos/briankung/projectcredo/events","assignees_url":"https://api.github.com/repos/briankung/projectcredo/assignees{/user}","branches_url":"https://api.github.com/repos/briankung/projectcredo/branches{/branch}","tags_url":"https://api.github.com/repos/briankung/projectcredo/tags","blobs_url":"https://api.github.com/repos/briankung/projectcredo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/briankung/projectcredo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/briankung/projectcredo/git/refs{/sha}","trees_url":"https://api.github.com/repos/briankung/projectcredo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/briankung/projectcredo/statuses/{sha}","languages_url":"https://api.github.com/repos/briankung/projectcredo/languages","stargazers_url":"https://api.github.com/repos/briankung/projectcredo/stargazers","contributors_url":"https://api.github.com/repos/briankung/projectcredo/contributors","subscribers_url":"https://api.github.com/repos/briankung/projectcredo/subscribers","subscription_url":"https://api.github.com/repos/briankung/projectcredo/subscription","commits_url":"https://api.github.com/repos/briankung/projectcredo/commits{/sha}","git_commits_url":"https://api.github.com/repos/briankung/projectcredo/git/commits{/sha}","comments_url":"https://api.github.com/repos/briankung/projectcredo/comments{/number}","issue_comment_url":"https://api.github.com/repos/briankung/projectcredo/issues/comments{/number}","contents_url":"https://api.github.com/repos/briankung/projectcredo/contents/{+path}","compare_url":"https://api.github.com/repos/briankung/projectcredo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/briankung/projectcredo/merges","archive_url":"https://api.github.com/repos/briankung/projectcredo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/briankung/projectcredo/downloads","issues_url":"https://api.github.com/repos/briankung/projectcredo/issues{/number}","pulls_url":"https://api.github.com/repos/briankung/projectcredo/pulls{/number}","milestones_url":"https://api.github.com/repos/briankung/projectcredo/milestones{/number}","notifications_url":"https://api.github.com/repos/briankung/projectcredo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/briankung/projectcredo/labels{/name}","releases_url":"https://api.github.com/repos/briankung/projectcredo/releases{/id}","deployments_url":"https://api.github.com/repos/briankung/projectcredo/deployments","created_at":"2016-06-20T21:47:57Z","updated_at":"2016-06-20T21:48:15Z","pushed_at":"2016-09-13T00:52:40Z","git_url":"git://github.com/briankung/projectcredo.git","ssh_url":"git@github.com:briankung/projectcredo.git","clone_url":"https://github.com/briankung/projectcredo.git","svn_url":"https://github.com/briankung/projectcredo","homepage":null,"size":244,"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":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/briankung/projectcredo/pulls/76"},"html":{"href":"https://github.com/briankung/projectcredo/pull/76"},"issue":{"href":"https://api.github.com/repos/briankung/projectcredo/issues/76"},"comments":{"href":"https://api.github.com/repos/briankung/projectcredo/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/briankung/projectcredo/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/briankung/projectcredo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/briankung/projectcredo/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/briankung/projectcredo/statuses/bd9ccc1d5188018f4e9ce2f8322e79ce47719f79"}}}}
{"actor":{"display_login":"briankung"}}