{"action":"created","comment":{"url":"https://api.github.com/repos/PBadicean/SearchJob/pulls/comments/167526910","pull_request_review_id":95757046,"id":167526910,"diff_hunk":"@@ -33,11 +33,31 @@ class User < ApplicationRecord\n   mount_uploader :avatar, AvatarUploader\n \n   devise :database_authenticatable,\n-         :recoverable, :rememberable, :trackable, :validatable\n+         :recoverable, :rememberable, :trackable, :validatable,\n+         :omniauthable, omniauth_providers: [:facebook]\n+\n+  has_many :identities\n \n   enum role: { admin: 0, employer: 1, candidate: 2}\n   enum gender: { female: 0, male: 1}\n \n   validates :name, presence: true\n \n+  def self.find_for_oauth(auth)\n+    identity = Identity.where(provider: auth.provider, uid: auth.uid.to_s).first\n+    return identity.user if identity\n+\n+    email = auth.info.email\n+    user = User.where(email: email).first","path":"app/models/user.rb","position":20,"original_position":20,"commit_id":"cef7631a494953b0a9dab6f8ed758b045a572580","original_commit_id":"cef7631a494953b0a9dab6f8ed758b045a572580","user":{"login":"badimalex","id":4666600,"avatar_url":"https://avatars1.githubusercontent.com/u/4666600?v=4","gravatar_id":"","url":"https://api.github.com/users/badimalex","html_url":"https://github.com/badimalex","followers_url":"https://api.github.com/users/badimalex/followers","following_url":"https://api.github.com/users/badimalex/following{/other_user}","gists_url":"https://api.github.com/users/badimalex/gists{/gist_id}","starred_url":"https://api.github.com/users/badimalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badimalex/subscriptions","organizations_url":"https://api.github.com/users/badimalex/orgs","repos_url":"https://api.github.com/users/badimalex/repos","events_url":"https://api.github.com/users/badimalex/events{/privacy}","received_events_url":"https://api.github.com/users/badimalex/received_events","type":"User","site_admin":false},"body":"User.find_by(email: email)","created_at":"2018-02-12T11:24:18Z","updated_at":"2018-02-12T11:24:18Z","html_url":"https://github.com/PBadicean/SearchJob/pull/9#discussion_r167526910","pull_request_url":"https://api.github.com/repos/PBadicean/SearchJob/pulls/9","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/PBadicean/SearchJob/pulls/comments/167526910"},"html":{"href":"https://github.com/PBadicean/SearchJob/pull/9#discussion_r167526910"},"pull_request":{"href":"https://api.github.com/repos/PBadicean/SearchJob/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/PBadicean/SearchJob/pulls/9","id":168552025,"html_url":"https://github.com/PBadicean/SearchJob/pull/9","diff_url":"https://github.com/PBadicean/SearchJob/pull/9.diff","patch_url":"https://github.com/PBadicean/SearchJob/pull/9.patch","issue_url":"https://api.github.com/repos/PBadicean/SearchJob/issues/9","number":9,"state":"open","locked":false,"title":"Authenticate facebook","user":{"login":"PBadicean","id":26254827,"avatar_url":"https://avatars0.githubusercontent.com/u/26254827?v=4","gravatar_id":"","url":"https://api.github.com/users/PBadicean","html_url":"https://github.com/PBadicean","followers_url":"https://api.github.com/users/PBadicean/followers","following_url":"https://api.github.com/users/PBadicean/following{/other_user}","gists_url":"https://api.github.com/users/PBadicean/gists{/gist_id}","starred_url":"https://api.github.com/users/PBadicean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PBadicean/subscriptions","organizations_url":"https://api.github.com/users/PBadicean/orgs","repos_url":"https://api.github.com/users/PBadicean/repos","events_url":"https://api.github.com/users/PBadicean/events{/privacy}","received_events_url":"https://api.github.com/users/PBadicean/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-12T11:14:40Z","updated_at":"2018-02-12T11:24:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd5b8ebcac22b6a53ed308b1ba60de0173794482","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/PBadicean/SearchJob/pulls/9/commits","review_comments_url":"https://api.github.com/repos/PBadicean/SearchJob/pulls/9/comments","review_comment_url":"https://api.github.com/repos/PBadicean/SearchJob/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PBadicean/SearchJob/issues/9/comments","statuses_url":"https://api.github.com/repos/PBadicean/SearchJob/statuses/cef7631a494953b0a9dab6f8ed758b045a572580","head":{"label":"PBadicean:auth-facebook","ref":"auth-facebook","sha":"cef7631a494953b0a9dab6f8ed758b045a572580","user":{"login":"PBadicean","id":26254827,"avatar_url":"https://avatars0.githubusercontent.com/u/26254827?v=4","gravatar_id":"","url":"https://api.github.com/users/PBadicean","html_url":"https://github.com/PBadicean","followers_url":"https://api.github.com/users/PBadicean/followers","following_url":"https://api.github.com/users/PBadicean/following{/other_user}","gists_url":"https://api.github.com/users/PBadicean/gists{/gist_id}","starred_url":"https://api.github.com/users/PBadicean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PBadicean/subscriptions","organizations_url":"https://api.github.com/users/PBadicean/orgs","repos_url":"https://api.github.com/users/PBadicean/repos","events_url":"https://api.github.com/users/PBadicean/events{/privacy}","received_events_url":"https://api.github.com/users/PBadicean/received_events","type":"User","site_admin":false},"repo":{"id":116009583,"name":"SearchJob","full_name":"PBadicean/SearchJob","owner":{"login":"PBadicean","id":26254827,"avatar_url":"https://avatars0.githubusercontent.com/u/26254827?v=4","gravatar_id":"","url":"https://api.github.com/users/PBadicean","html_url":"https://github.com/PBadicean","followers_url":"https://api.github.com/users/PBadicean/followers","following_url":"https://api.github.com/users/PBadicean/following{/other_user}","gists_url":"https://api.github.com/users/PBadicean/gists{/gist_id}","starred_url":"https://api.github.com/users/PBadicean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PBadicean/subscriptions","organizations_url":"https://api.github.com/users/PBadicean/orgs","repos_url":"https://api.github.com/users/PBadicean/repos","events_url":"https://api.github.com/users/PBadicean/events{/privacy}","received_events_url":"https://api.github.com/users/PBadicean/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PBadicean/SearchJob","description":null,"fork":false,"url":"https://api.github.com/repos/PBadicean/SearchJob","forks_url":"https://api.github.com/repos/PBadicean/SearchJob/forks","keys_url":"https://api.github.com/repos/PBadicean/SearchJob/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PBadicean/SearchJob/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PBadicean/SearchJob/teams","hooks_url":"https://api.github.com/repos/PBadicean/SearchJob/hooks","issue_events_url":"https://api.github.com/repos/PBadicean/SearchJob/issues/events{/number}","events_url":"https://api.github.com/repos/PBadicean/SearchJob/events","assignees_url":"https://api.github.com/repos/PBadicean/SearchJob/assignees{/user}","branches_url":"https://api.github.com/repos/PBadicean/SearchJob/branches{/branch}","tags_url":"https://api.github.com/repos/PBadicean/SearchJob/tags","blobs_url":"https://api.github.com/repos/PBadicean/SearchJob/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PBadicean/SearchJob/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PBadicean/SearchJob/git/refs{/sha}","trees_url":"https://api.github.com/repos/PBadicean/SearchJob/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PBadicean/SearchJob/statuses/{sha}","languages_url":"https://api.github.com/repos/PBadicean/SearchJob/languages","stargazers_url":"https://api.github.com/repos/PBadicean/SearchJob/stargazers","contributors_url":"https://api.github.com/repos/PBadicean/SearchJob/contributors","subscribers_url":"https://api.github.com/repos/PBadicean/SearchJob/subscribers","subscription_url":"https://api.github.com/repos/PBadicean/SearchJob/subscription","commits_url":"https://api.github.com/repos/PBadicean/SearchJob/commits{/sha}","git_commits_url":"https://api.github.com/repos/PBadicean/SearchJob/git/commits{/sha}","comments_url":"https://api.github.com/repos/PBadicean/SearchJob/comments{/number}","issue_comment_url":"https://api.github.com/repos/PBadicean/SearchJob/issues/comments{/number}","contents_url":"https://api.github.com/repos/PBadicean/SearchJob/contents/{+path}","compare_url":"https://api.github.com/repos/PBadicean/SearchJob/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PBadicean/SearchJob/merges","archive_url":"https://api.github.com/repos/PBadicean/SearchJob/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PBadicean/SearchJob/downloads","issues_url":"https://api.github.com/repos/PBadicean/SearchJob/issues{/number}","pulls_url":"https://api.github.com/repos/PBadicean/SearchJob/pulls{/number}","milestones_url":"https://api.github.com/repos/PBadicean/SearchJob/milestones{/number}","notifications_url":"https://api.github.com/repos/PBadicean/SearchJob/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PBadicean/SearchJob/labels{/name}","releases_url":"https://api.github.com/repos/PBadicean/SearchJob/releases{/id}","deployments_url":"https://api.github.com/repos/PBadicean/SearchJob/deployments","created_at":"2018-01-02T11:45:23Z","updated_at":"2018-01-02T11:45:58Z","pushed_at":"2018-02-12T11:14:41Z","git_url":"git://github.com/PBadicean/SearchJob.git","ssh_url":"git@github.com:PBadicean/SearchJob.git","clone_url":"https://github.com/PBadicean/SearchJob.git","svn_url":"https://github.com/PBadicean/SearchJob","homepage":null,"size":230,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"PBadicean:development","ref":"development","sha":"0e4d4bd299c39bd8f7f2c98285ca8047c99fbb45","user":{"login":"PBadicean","id":26254827,"avatar_url":"https://avatars0.githubusercontent.com/u/26254827?v=4","gravatar_id":"","url":"https://api.github.com/users/PBadicean","html_url":"https://github.com/PBadicean","followers_url":"https://api.github.com/users/PBadicean/followers","following_url":"https://api.github.com/users/PBadicean/following{/other_user}","gists_url":"https://api.github.com/users/PBadicean/gists{/gist_id}","starred_url":"https://api.github.com/users/PBadicean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PBadicean/subscriptions","organizations_url":"https://api.github.com/users/PBadicean/orgs","repos_url":"https://api.github.com/users/PBadicean/repos","events_url":"https://api.github.com/users/PBadicean/events{/privacy}","received_events_url":"https://api.github.com/users/PBadicean/received_events","type":"User","site_admin":false},"repo":{"id":116009583,"name":"SearchJob","full_name":"PBadicean/SearchJob","owner":{"login":"PBadicean","id":26254827,"avatar_url":"https://avatars0.githubusercontent.com/u/26254827?v=4","gravatar_id":"","url":"https://api.github.com/users/PBadicean","html_url":"https://github.com/PBadicean","followers_url":"https://api.github.com/users/PBadicean/followers","following_url":"https://api.github.com/users/PBadicean/following{/other_user}","gists_url":"https://api.github.com/users/PBadicean/gists{/gist_id}","starred_url":"https://api.github.com/users/PBadicean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PBadicean/subscriptions","organizations_url":"https://api.github.com/users/PBadicean/orgs","repos_url":"https://api.github.com/users/PBadicean/repos","events_url":"https://api.github.com/users/PBadicean/events{/privacy}","received_events_url":"https://api.github.com/users/PBadicean/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PBadicean/SearchJob","description":null,"fork":false,"url":"https://api.github.com/repos/PBadicean/SearchJob","forks_url":"https://api.github.com/repos/PBadicean/SearchJob/forks","keys_url":"https://api.github.com/repos/PBadicean/SearchJob/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PBadicean/SearchJob/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PBadicean/SearchJob/teams","hooks_url":"https://api.github.com/repos/PBadicean/SearchJob/hooks","issue_events_url":"https://api.github.com/repos/PBadicean/SearchJob/issues/events{/number}","events_url":"https://api.github.com/repos/PBadicean/SearchJob/events","assignees_url":"https://api.github.com/repos/PBadicean/SearchJob/assignees{/user}","branches_url":"https://api.github.com/repos/PBadicean/SearchJob/branches{/branch}","tags_url":"https://api.github.com/repos/PBadicean/SearchJob/tags","blobs_url":"https://api.github.com/repos/PBadicean/SearchJob/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PBadicean/SearchJob/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PBadicean/SearchJob/git/refs{/sha}","trees_url":"https://api.github.com/repos/PBadicean/SearchJob/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PBadicean/SearchJob/statuses/{sha}","languages_url":"https://api.github.com/repos/PBadicean/SearchJob/languages","stargazers_url":"https://api.github.com/repos/PBadicean/SearchJob/stargazers","contributors_url":"https://api.github.com/repos/PBadicean/SearchJob/contributors","subscribers_url":"https://api.github.com/repos/PBadicean/SearchJob/subscribers","subscription_url":"https://api.github.com/repos/PBadicean/SearchJob/subscription","commits_url":"https://api.github.com/repos/PBadicean/SearchJob/commits{/sha}","git_commits_url":"https://api.github.com/repos/PBadicean/SearchJob/git/commits{/sha}","comments_url":"https://api.github.com/repos/PBadicean/SearchJob/comments{/number}","issue_comment_url":"https://api.github.com/repos/PBadicean/SearchJob/issues/comments{/number}","contents_url":"https://api.github.com/repos/PBadicean/SearchJob/contents/{+path}","compare_url":"https://api.github.com/repos/PBadicean/SearchJob/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PBadicean/SearchJob/merges","archive_url":"https://api.github.com/repos/PBadicean/SearchJob/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PBadicean/SearchJob/downloads","issues_url":"https://api.github.com/repos/PBadicean/SearchJob/issues{/number}","pulls_url":"https://api.github.com/repos/PBadicean/SearchJob/pulls{/number}","milestones_url":"https://api.github.com/repos/PBadicean/SearchJob/milestones{/number}","notifications_url":"https://api.github.com/repos/PBadicean/SearchJob/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PBadicean/SearchJob/labels{/name}","releases_url":"https://api.github.com/repos/PBadicean/SearchJob/releases{/id}","deployments_url":"https://api.github.com/repos/PBadicean/SearchJob/deployments","created_at":"2018-01-02T11:45:23Z","updated_at":"2018-01-02T11:45:58Z","pushed_at":"2018-02-12T11:14:41Z","git_url":"git://github.com/PBadicean/SearchJob.git","ssh_url":"git@github.com:PBadicean/SearchJob.git","clone_url":"https://github.com/PBadicean/SearchJob.git","svn_url":"https://github.com/PBadicean/SearchJob","homepage":null,"size":230,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PBadicean/SearchJob/pulls/9"},"html":{"href":"https://github.com/PBadicean/SearchJob/pull/9"},"issue":{"href":"https://api.github.com/repos/PBadicean/SearchJob/issues/9"},"comments":{"href":"https://api.github.com/repos/PBadicean/SearchJob/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/PBadicean/SearchJob/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/PBadicean/SearchJob/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PBadicean/SearchJob/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/PBadicean/SearchJob/statuses/cef7631a494953b0a9dab6f8ed758b045a572580"}},"author_association":"OWNER"}}
{"actor":{"display_login":"badimalex"}}