GitHub PullRequestReviewCommentEvent at 2014-08-14 09:18:26
Repository: lunchman
Actor: tanimichi
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/dnond/lunchman/pulls/comments/16228221","id":16228221,"diff_hunk":"@@ -1,6 +1,53 @@\n class User < ActiveRecord::Base\n-  # Include default devise modules. Others available are:\n-  # :confirmable, :lockable, :timeoutable and :omniauthable\n-  devise :database_authenticatable, :registerable,\n-         :recoverable, :rememberable, :trackable, :validatable\n+\t# Include default devise modules. Others available are:\n+\t# :confirmable, :lockable, :timeoutable and :omniauthable\n+\tdevise :database_authenticatable, :registerable,\n+\t\t\t\t :recoverable, :rememberable, :trackable, :validatable, :omniauthable\n+\n+\n+\tdef self.find_for_oauth(auth, signed_in_user = nil)\n+\n+\t\tidentity = Identity.find_for_oauth(auth)\n+\n+\t\t# ログイン済のユーザー？\n+\t\tuser = signed_in_user ? signed_in_user : identity.user\n+\n+\t\tif user.nil?\n+\t\t\tif auth.provider == 'google_oauth2'\n+\t\t\t\temail = auth.info.email\n+\t\t\telse\n+\t\t\t\t# twitter、facebookの場合？\n+\t\t\t\t# http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/\n+\t\t\t\temail_is_verified = auth.info.email && (auth.info.verified || auth.info.verified_email)\n+\t\t\t\temail = auth.info.email if email_is_verified\n+\t\t\tend\n+\n+\t\t\t# メルアドで検索\n+\t\t\tuser = User.where(:email => email).first if email\n+\n+\n+\t\t\tif user.nil?\n+\t\t\t\t#ユーザーが見つからないので、deviseユーザーテーブルに登録する\n+\t\t\t\tuser = User.new(\n+\t\t\t\t\tname: auth.extra.raw_info.name,\n+\t\t\t\t\temail: email,\n+\t\t\t\t\tpassword: Devise.friendly_token[0,20]\n+\t\t\t\t)\n+\t\t\t\t# user.skip_confirmation! #確認メールは送らない\n+\t\t\t\tuser.save!\n+\t\t\tend\n+\t\tend\n+","path":"app/models/user.rb","position":44,"original_position":44,"commit_id":"4ac71a1c811684e8f5d0a0130124d22b416b6470","original_commit_id":"4ac71a1c811684e8f5d0a0130124d22b416b6470","user":{"login":"tanimichi","id":5486854,"avatar_url":"https://avatars.githubusercontent.com/u/5486854?v=2","gravatar_id":"f0e8818ca41a6c8ca69099e74e46e1b2","url":"https://api.github.com/users/tanimichi","html_url":"https://github.com/tanimichi","followers_url":"https://api.github.com/users/tanimichi/followers","following_url":"https://api.github.com/users/tanimichi/following{/other_user}","gists_url":"https://api.github.com/users/tanimichi/gists{/gist_id}","starred_url":"https://api.github.com/users/tanimichi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanimichi/subscriptions","organizations_url":"https://api.github.com/users/tanimichi/orgs","repos_url":"https://api.github.com/users/tanimichi/repos","events_url":"https://api.github.com/users/tanimichi/events{/privacy}","received_events_url":"https://api.github.com/users/tanimichi/received_events","type":"User","site_admin":false},"body":"ここあたりとかif式がネストしてて何かしらの抽象化をしたほうがいいと思うんですが、インデントの影響で読むのが難しいので、とりあえずインデントを直してもらってから、このpul-reqに再pushしてもらえます？","created_at":"2014-08-14T09:18:26Z","updated_at":"2014-08-14T09:18:26Z","html_url":"https://github.com/dnond/lunchman/pull/1#discussion_r16228221","pull_request_url":"https://api.github.com/repos/dnond/lunchman/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/dnond/lunchman/pulls/comments/16228221"},"html":{"href":"https://github.com/dnond/lunchman/pull/1#discussion_r16228221"},"pull_request":{"href":"https://api.github.com/repos/dnond/lunchman/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/dnond/lunchman/pulls/1","id":19775169,"html_url":"https://github.com/dnond/lunchman/pull/1","diff_url":"https://github.com/dnond/lunchman/pull/1.diff","patch_url":"https://github.com/dnond/lunchman/pull/1.patch","issue_url":"https://api.github.com/repos/dnond/lunchman/issues/1","number":1,"state":"open","locked":false,"title":"Googleアカでのログイン機能","user":{"login":"dnond","id":3064024,"avatar_url":"https://avatars.githubusercontent.com/u/3064024?v=2","gravatar_id":"f4c9d680f5ee42cebabe1bf67d34301f","url":"https://api.github.com/users/dnond","html_url":"https://github.com/dnond","followers_url":"https://api.github.com/users/dnond/followers","following_url":"https://api.github.com/users/dnond/following{/other_user}","gists_url":"https://api.github.com/users/dnond/gists{/gist_id}","starred_url":"https://api.github.com/users/dnond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnond/subscriptions","organizations_url":"https://api.github.com/users/dnond/orgs","repos_url":"https://api.github.com/users/dnond/repos","events_url":"https://api.github.com/users/dnond/events{/privacy}","received_events_url":"https://api.github.com/users/dnond/received_events","type":"User","site_admin":false},"body":"Googleのアカウントでアプリ連携し、DBにユーザー情報を記録する。\r\nログイン後のページでは、記録したユーザー情報を表示する。\r\n\r\n（ログイン・ログイン後ページのURLは仮）","created_at":"2014-08-14T08:55:46Z","updated_at":"2014-08-14T09:18:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23552bae39dd7c96cd9edbd2c3dd8b0d2750413b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dnond/lunchman/pulls/1/commits","review_comments_url":"https://api.github.com/repos/dnond/lunchman/pulls/1/comments","review_comment_url":"https://api.github.com/repos/dnond/lunchman/pulls/comments/{number}","comments_url":"https://api.github.com/repos/dnond/lunchman/issues/1/comments","statuses_url":"https://api.github.com/repos/dnond/lunchman/statuses/4ac71a1c811684e8f5d0a0130124d22b416b6470","head":{"label":"dnond:user_registation","ref":"user_registation","sha":"4ac71a1c811684e8f5d0a0130124d22b416b6470","user":{"login":"dnond","id":3064024,"avatar_url":"https://avatars.githubusercontent.com/u/3064024?v=2","gravatar_id":"f4c9d680f5ee42cebabe1bf67d34301f","url":"https://api.github.com/users/dnond","html_url":"https://github.com/dnond","followers_url":"https://api.github.com/users/dnond/followers","following_url":"https://api.github.com/users/dnond/following{/other_user}","gists_url":"https://api.github.com/users/dnond/gists{/gist_id}","starred_url":"https://api.github.com/users/dnond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnond/subscriptions","organizations_url":"https://api.github.com/users/dnond/orgs","repos_url":"https://api.github.com/users/dnond/repos","events_url":"https://api.github.com/users/dnond/events{/privacy}","received_events_url":"https://api.github.com/users/dnond/received_events","type":"User","site_admin":false},"repo":{"id":22936961,"name":"lunchman","full_name":"dnond/lunchman","owner":{"login":"dnond","id":3064024,"avatar_url":"https://avatars.githubusercontent.com/u/3064024?v=2","gravatar_id":"f4c9d680f5ee42cebabe1bf67d34301f","url":"https://api.github.com/users/dnond","html_url":"https://github.com/dnond","followers_url":"https://api.github.com/users/dnond/followers","following_url":"https://api.github.com/users/dnond/following{/other_user}","gists_url":"https://api.github.com/users/dnond/gists{/gist_id}","starred_url":"https://api.github.com/users/dnond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnond/subscriptions","organizations_url":"https://api.github.com/users/dnond/orgs","repos_url":"https://api.github.com/users/dnond/repos","events_url":"https://api.github.com/users/dnond/events{/privacy}","received_events_url":"https://api.github.com/users/dnond/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dnond/lunchman","description":"","fork":false,"url":"https://api.github.com/repos/dnond/lunchman","forks_url":"https://api.github.com/repos/dnond/lunchman/forks","keys_url":"https://api.github.com/repos/dnond/lunchman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dnond/lunchman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dnond/lunchman/teams","hooks_url":"https://api.github.com/repos/dnond/lunchman/hooks","issue_events_url":"https://api.github.com/repos/dnond/lunchman/issues/events{/number}","events_url":"https://api.github.com/repos/dnond/lunchman/events","assignees_url":"https://api.github.com/repos/dnond/lunchman/assignees{/user}","branches_url":"https://api.github.com/repos/dnond/lunchman/branches{/branch}","tags_url":"https://api.github.com/repos/dnond/lunchman/tags","blobs_url":"https://api.github.com/repos/dnond/lunchman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dnond/lunchman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dnond/lunchman/git/refs{/sha}","trees_url":"https://api.github.com/repos/dnond/lunchman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dnond/lunchman/statuses/{sha}","languages_url":"https://api.github.com/repos/dnond/lunchman/languages","stargazers_url":"https://api.github.com/repos/dnond/lunchman/stargazers","contributors_url":"https://api.github.com/repos/dnond/lunchman/contributors","subscribers_url":"https://api.github.com/repos/dnond/lunchman/subscribers","subscription_url":"https://api.github.com/repos/dnond/lunchman/subscription","commits_url":"https://api.github.com/repos/dnond/lunchman/commits{/sha}","git_commits_url":"https://api.github.com/repos/dnond/lunchman/git/commits{/sha}","comments_url":"https://api.github.com/repos/dnond/lunchman/comments{/number}","issue_comment_url":"https://api.github.com/repos/dnond/lunchman/issues/comments/{number}","contents_url":"https://api.github.com/repos/dnond/lunchman/contents/{+path}","compare_url":"https://api.github.com/repos/dnond/lunchman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dnond/lunchman/merges","archive_url":"https://api.github.com/repos/dnond/lunchman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dnond/lunchman/downloads","issues_url":"https://api.github.com/repos/dnond/lunchman/issues{/number}","pulls_url":"https://api.github.com/repos/dnond/lunchman/pulls{/number}","milestones_url":"https://api.github.com/repos/dnond/lunchman/milestones{/number}","notifications_url":"https://api.github.com/repos/dnond/lunchman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dnond/lunchman/labels{/name}","releases_url":"https://api.github.com/repos/dnond/lunchman/releases{/id}","created_at":"2014-08-14T01:21:55Z","updated_at":"2014-08-14T01:40:43Z","pushed_at":"2014-08-14T08:54:02Z","git_url":"git://github.com/dnond/lunchman.git","ssh_url":"git@github.com:dnond/lunchman.git","clone_url":"https://github.com/dnond/lunchman.git","svn_url":"https://github.com/dnond/lunchman","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"dnond:master","ref":"master","sha":"cf20bf750999d23148c1de1303934c42217ab102","user":{"login":"dnond","id":3064024,"avatar_url":"https://avatars.githubusercontent.com/u/3064024?v=2","gravatar_id":"f4c9d680f5ee42cebabe1bf67d34301f","url":"https://api.github.com/users/dnond","html_url":"https://github.com/dnond","followers_url":"https://api.github.com/users/dnond/followers","following_url":"https://api.github.com/users/dnond/following{/other_user}","gists_url":"https://api.github.com/users/dnond/gists{/gist_id}","starred_url":"https://api.github.com/users/dnond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnond/subscriptions","organizations_url":"https://api.github.com/users/dnond/orgs","repos_url":"https://api.github.com/users/dnond/repos","events_url":"https://api.github.com/users/dnond/events{/privacy}","received_events_url":"https://api.github.com/users/dnond/received_events","type":"User","site_admin":false},"repo":{"id":22936961,"name":"lunchman","full_name":"dnond/lunchman","owner":{"login":"dnond","id":3064024,"avatar_url":"https://avatars.githubusercontent.com/u/3064024?v=2","gravatar_id":"f4c9d680f5ee42cebabe1bf67d34301f","url":"https://api.github.com/users/dnond","html_url":"https://github.com/dnond","followers_url":"https://api.github.com/users/dnond/followers","following_url":"https://api.github.com/users/dnond/following{/other_user}","gists_url":"https://api.github.com/users/dnond/gists{/gist_id}","starred_url":"https://api.github.com/users/dnond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnond/subscriptions","organizations_url":"https://api.github.com/users/dnond/orgs","repos_url":"https://api.github.com/users/dnond/repos","events_url":"https://api.github.com/users/dnond/events{/privacy}","received_events_url":"https://api.github.com/users/dnond/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dnond/lunchman","description":"","fork":false,"url":"https://api.github.com/repos/dnond/lunchman","forks_url":"https://api.github.com/repos/dnond/lunchman/forks","keys_url":"https://api.github.com/repos/dnond/lunchman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dnond/lunchman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dnond/lunchman/teams","hooks_url":"https://api.github.com/repos/dnond/lunchman/hooks","issue_events_url":"https://api.github.com/repos/dnond/lunchman/issues/events{/number}","events_url":"https://api.github.com/repos/dnond/lunchman/events","assignees_url":"https://api.github.com/repos/dnond/lunchman/assignees{/user}","branches_url":"https://api.github.com/repos/dnond/lunchman/branches{/branch}","tags_url":"https://api.github.com/repos/dnond/lunchman/tags","blobs_url":"https://api.github.com/repos/dnond/lunchman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dnond/lunchman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dnond/lunchman/git/refs{/sha}","trees_url":"https://api.github.com/repos/dnond/lunchman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dnond/lunchman/statuses/{sha}","languages_url":"https://api.github.com/repos/dnond/lunchman/languages","stargazers_url":"https://api.github.com/repos/dnond/lunchman/stargazers","contributors_url":"https://api.github.com/repos/dnond/lunchman/contributors","subscribers_url":"https://api.github.com/repos/dnond/lunchman/subscribers","subscription_url":"https://api.github.com/repos/dnond/lunchman/subscription","commits_url":"https://api.github.com/repos/dnond/lunchman/commits{/sha}","git_commits_url":"https://api.github.com/repos/dnond/lunchman/git/commits{/sha}","comments_url":"https://api.github.com/repos/dnond/lunchman/comments{/number}","issue_comment_url":"https://api.github.com/repos/dnond/lunchman/issues/comments/{number}","contents_url":"https://api.github.com/repos/dnond/lunchman/contents/{+path}","compare_url":"https://api.github.com/repos/dnond/lunchman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dnond/lunchman/merges","archive_url":"https://api.github.com/repos/dnond/lunchman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dnond/lunchman/downloads","issues_url":"https://api.github.com/repos/dnond/lunchman/issues{/number}","pulls_url":"https://api.github.com/repos/dnond/lunchman/pulls{/number}","milestones_url":"https://api.github.com/repos/dnond/lunchman/milestones{/number}","notifications_url":"https://api.github.com/repos/dnond/lunchman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dnond/lunchman/labels{/name}","releases_url":"https://api.github.com/repos/dnond/lunchman/releases{/id}","created_at":"2014-08-14T01:21:55Z","updated_at":"2014-08-14T01:40:43Z","pushed_at":"2014-08-14T08:54:02Z","git_url":"git://github.com/dnond/lunchman.git","ssh_url":"git@github.com:dnond/lunchman.git","clone_url":"https://github.com/dnond/lunchman.git","svn_url":"https://github.com/dnond/lunchman","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dnond/lunchman/pulls/1"},"html":{"href":"https://github.com/dnond/lunchman/pull/1"},"issue":{"href":"https://api.github.com/repos/dnond/lunchman/issues/1"},"comments":{"href":"https://api.github.com/repos/dnond/lunchman/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/dnond/lunchman/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/dnond/lunchman/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/dnond/lunchman/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/dnond/lunchman/statuses/4ac71a1c811684e8f5d0a0130124d22b416b6470"}}}}