{"action":"created","comment":{"url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/comments/59985756","id":59985756,"diff_hunk":"@@ -1,4 +1,6 @@\n class SessionsController < ApplicationController\n+  before_action :require_to_signin, only: :destroy\n+","path":"app/controllers/sessions_controller.rb","position":3,"original_position":3,"commit_id":"6b2da4c25e2f7df7bc07e87616efe655bb01cb60","original_commit_id":"6b2da4c25e2f7df7bc07e87616efe655bb01cb60","user":{"login":"yucao24hours","id":1979779,"avatar_url":"https://avatars.githubusercontent.com/u/1979779?v=3","gravatar_id":"","url":"https://api.github.com/users/yucao24hours","html_url":"https://github.com/yucao24hours","followers_url":"https://api.github.com/users/yucao24hours/followers","following_url":"https://api.github.com/users/yucao24hours/following{/other_user}","gists_url":"https://api.github.com/users/yucao24hours/gists{/gist_id}","starred_url":"https://api.github.com/users/yucao24hours/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yucao24hours/subscriptions","organizations_url":"https://api.github.com/users/yucao24hours/orgs","repos_url":"https://api.github.com/users/yucao24hours/repos","events_url":"https://api.github.com/users/yucao24hours/events{/privacy}","received_events_url":"https://api.github.com/users/yucao24hours/received_events","type":"User","site_admin":false},"body":"> ApplicationController からの継承関係からすると、意味合い的に\r\n\r\nアプリ全体としては `require_to_login` したいけど、ここのアクションだけは例外で対象から除きたいから skip してねっという意図を出せるように！っという意味ですよね。\r\nそのとおりですね :readable: ありがとうございます 🙏 ","created_at":"2016-04-17T14:42:32Z","updated_at":"2016-04-17T14:42:32Z","html_url":"https://github.com/yochiyochirb/kajaeru/pull/163#discussion_r59985756","pull_request_url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/163","_links":{"self":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/comments/59985756"},"html":{"href":"https://github.com/yochiyochirb/kajaeru/pull/163#discussion_r59985756"},"pull_request":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/163"}}},"pull_request":{"url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/163","id":65073773,"html_url":"https://github.com/yochiyochirb/kajaeru/pull/163","diff_url":"https://github.com/yochiyochirb/kajaeru/pull/163.diff","patch_url":"https://github.com/yochiyochirb/kajaeru/pull/163.patch","issue_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/163","number":163,"state":"open","locked":false,"title":"ログインしていなくても投票画面にアクセスできてしまうのを直した [closes #154]","user":{"login":"yucao24hours","id":1979779,"avatar_url":"https://avatars.githubusercontent.com/u/1979779?v=3","gravatar_id":"","url":"https://api.github.com/users/yucao24hours","html_url":"https://github.com/yucao24hours","followers_url":"https://api.github.com/users/yucao24hours/followers","following_url":"https://api.github.com/users/yucao24hours/following{/other_user}","gists_url":"https://api.github.com/users/yucao24hours/gists{/gist_id}","starred_url":"https://api.github.com/users/yucao24hours/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yucao24hours/subscriptions","organizations_url":"https://api.github.com/users/yucao24hours/orgs","repos_url":"https://api.github.com/users/yucao24hours/repos","events_url":"https://api.github.com/users/yucao24hours/events{/privacy}","received_events_url":"https://api.github.com/users/yucao24hours/received_events","type":"User","site_admin":false},"body":"<!--\r\n↑ Pull Request のタイトルに [closes #nnn] という文言を追加すると、この PR がマージされたときにその番号の issue を同時に close してくれます\r\n-->\r\n\r\n## やったこと\r\n\r\n原則として、現時点では GitHub サインインをしていない状態ではアプリのあらゆる機能を使えないようにしたいため、最初にサインイン済みかどうかを確認する処理を追加しました。\r\n\r\n~~この処理が確実に行われているかどうかの確認のために、 flash メッセージを出してエラー内容を使用者にちゃんと伝えているか（\"サインインが必要なので、サインインしてくださいね〜\" ということ）を見たかったのだけど、 #161 に挙がっている issue にあるように members/index.html.haml 以外では flash を出すしくみが入っていないため、それを確認できない。\r\nそのため、ひとまずこのブランチはこのままにして、先に #161 をたおしてくる。~~ たおしたので実装しました。\r\n\r\n## TODO\r\n\r\n- [x] #154 を実装してマージする -> #164 で実装してるのでそれをマージする\r\n- [x] ~~E2E テストを書く~~ 存在するページすべてに直接アクセスするテストをかくのはあまりイケテナイ気がするので、 Minitest で `current_user` が入っていない状態の確認をするほうがよさそう。-> いちどバグになっていて不安なので、E2E でも確認したい。\r\n- [x] サインインしているかどうかを確認する処理を、アプリ全体で行うようにする（既に MembersController にはあるので、それをアプリ全体で使えるようにするイメージ）\r\n\r\n## 対応する issue\r\n\r\n<!--\r\nconnects to #nnn みたいに書くと、Waffle.io でその issue と PR をくっつけて表示してくれます\r\n-->\r\n\r\nconnects to #154 ","created_at":"2016-04-03T16:58:57Z","updated_at":"2016-04-17T14:42:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34d1809808ddd87f3c17f9e6482a127814435311","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/163/commits","review_comments_url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/163/comments","review_comment_url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/163/comments","statuses_url":"https://api.github.com/repos/yochiyochirb/kajaeru/statuses/6b2da4c25e2f7df7bc07e87616efe655bb01cb60","head":{"label":"yochiyochirb:require-login-to-vote","ref":"require-login-to-vote","sha":"6b2da4c25e2f7df7bc07e87616efe655bb01cb60","user":{"login":"yochiyochirb","id":6112628,"avatar_url":"https://avatars.githubusercontent.com/u/6112628?v=3","gravatar_id":"","url":"https://api.github.com/users/yochiyochirb","html_url":"https://github.com/yochiyochirb","followers_url":"https://api.github.com/users/yochiyochirb/followers","following_url":"https://api.github.com/users/yochiyochirb/following{/other_user}","gists_url":"https://api.github.com/users/yochiyochirb/gists{/gist_id}","starred_url":"https://api.github.com/users/yochiyochirb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yochiyochirb/subscriptions","organizations_url":"https://api.github.com/users/yochiyochirb/orgs","repos_url":"https://api.github.com/users/yochiyochirb/repos","events_url":"https://api.github.com/users/yochiyochirb/events{/privacy}","received_events_url":"https://api.github.com/users/yochiyochirb/received_events","type":"Organization","site_admin":false},"repo":{"id":22510813,"name":"kajaeru","full_name":"yochiyochirb/kajaeru","owner":{"login":"yochiyochirb","id":6112628,"avatar_url":"https://avatars.githubusercontent.com/u/6112628?v=3","gravatar_id":"","url":"https://api.github.com/users/yochiyochirb","html_url":"https://github.com/yochiyochirb","followers_url":"https://api.github.com/users/yochiyochirb/followers","following_url":"https://api.github.com/users/yochiyochirb/following{/other_user}","gists_url":"https://api.github.com/users/yochiyochirb/gists{/gist_id}","starred_url":"https://api.github.com/users/yochiyochirb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yochiyochirb/subscriptions","organizations_url":"https://api.github.com/users/yochiyochirb/orgs","repos_url":"https://api.github.com/users/yochiyochirb/repos","events_url":"https://api.github.com/users/yochiyochirb/events{/privacy}","received_events_url":"https://api.github.com/users/yochiyochirb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yochiyochirb/kajaeru","description":"","fork":false,"url":"https://api.github.com/repos/yochiyochirb/kajaeru","forks_url":"https://api.github.com/repos/yochiyochirb/kajaeru/forks","keys_url":"https://api.github.com/repos/yochiyochirb/kajaeru/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yochiyochirb/kajaeru/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yochiyochirb/kajaeru/teams","hooks_url":"https://api.github.com/repos/yochiyochirb/kajaeru/hooks","issue_events_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/events{/number}","events_url":"https://api.github.com/repos/yochiyochirb/kajaeru/events","assignees_url":"https://api.github.com/repos/yochiyochirb/kajaeru/assignees{/user}","branches_url":"https://api.github.com/repos/yochiyochirb/kajaeru/branches{/branch}","tags_url":"https://api.github.com/repos/yochiyochirb/kajaeru/tags","blobs_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/refs{/sha}","trees_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yochiyochirb/kajaeru/statuses/{sha}","languages_url":"https://api.github.com/repos/yochiyochirb/kajaeru/languages","stargazers_url":"https://api.github.com/repos/yochiyochirb/kajaeru/stargazers","contributors_url":"https://api.github.com/repos/yochiyochirb/kajaeru/contributors","subscribers_url":"https://api.github.com/repos/yochiyochirb/kajaeru/subscribers","subscription_url":"https://api.github.com/repos/yochiyochirb/kajaeru/subscription","commits_url":"https://api.github.com/repos/yochiyochirb/kajaeru/commits{/sha}","git_commits_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/commits{/sha}","comments_url":"https://api.github.com/repos/yochiyochirb/kajaeru/comments{/number}","issue_comment_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/comments{/number}","contents_url":"https://api.github.com/repos/yochiyochirb/kajaeru/contents/{+path}","compare_url":"https://api.github.com/repos/yochiyochirb/kajaeru/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yochiyochirb/kajaeru/merges","archive_url":"https://api.github.com/repos/yochiyochirb/kajaeru/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yochiyochirb/kajaeru/downloads","issues_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues{/number}","pulls_url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls{/number}","milestones_url":"https://api.github.com/repos/yochiyochirb/kajaeru/milestones{/number}","notifications_url":"https://api.github.com/repos/yochiyochirb/kajaeru/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yochiyochirb/kajaeru/labels{/name}","releases_url":"https://api.github.com/repos/yochiyochirb/kajaeru/releases{/id}","deployments_url":"https://api.github.com/repos/yochiyochirb/kajaeru/deployments","created_at":"2014-08-01T13:29:32Z","updated_at":"2016-03-10T13:58:29Z","pushed_at":"2016-04-17T14:23:37Z","git_url":"git://github.com/yochiyochirb/kajaeru.git","ssh_url":"git@github.com:yochiyochirb/kajaeru.git","clone_url":"https://github.com/yochiyochirb/kajaeru.git","svn_url":"https://github.com/yochiyochirb/kajaeru","homepage":null,"size":393,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":19,"forks":3,"open_issues":19,"watchers":15,"default_branch":"master"}},"base":{"label":"yochiyochirb:master","ref":"master","sha":"13aecee0439a0980afffdadb00777b6a1030ef26","user":{"login":"yochiyochirb","id":6112628,"avatar_url":"https://avatars.githubusercontent.com/u/6112628?v=3","gravatar_id":"","url":"https://api.github.com/users/yochiyochirb","html_url":"https://github.com/yochiyochirb","followers_url":"https://api.github.com/users/yochiyochirb/followers","following_url":"https://api.github.com/users/yochiyochirb/following{/other_user}","gists_url":"https://api.github.com/users/yochiyochirb/gists{/gist_id}","starred_url":"https://api.github.com/users/yochiyochirb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yochiyochirb/subscriptions","organizations_url":"https://api.github.com/users/yochiyochirb/orgs","repos_url":"https://api.github.com/users/yochiyochirb/repos","events_url":"https://api.github.com/users/yochiyochirb/events{/privacy}","received_events_url":"https://api.github.com/users/yochiyochirb/received_events","type":"Organization","site_admin":false},"repo":{"id":22510813,"name":"kajaeru","full_name":"yochiyochirb/kajaeru","owner":{"login":"yochiyochirb","id":6112628,"avatar_url":"https://avatars.githubusercontent.com/u/6112628?v=3","gravatar_id":"","url":"https://api.github.com/users/yochiyochirb","html_url":"https://github.com/yochiyochirb","followers_url":"https://api.github.com/users/yochiyochirb/followers","following_url":"https://api.github.com/users/yochiyochirb/following{/other_user}","gists_url":"https://api.github.com/users/yochiyochirb/gists{/gist_id}","starred_url":"https://api.github.com/users/yochiyochirb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yochiyochirb/subscriptions","organizations_url":"https://api.github.com/users/yochiyochirb/orgs","repos_url":"https://api.github.com/users/yochiyochirb/repos","events_url":"https://api.github.com/users/yochiyochirb/events{/privacy}","received_events_url":"https://api.github.com/users/yochiyochirb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yochiyochirb/kajaeru","description":"","fork":false,"url":"https://api.github.com/repos/yochiyochirb/kajaeru","forks_url":"https://api.github.com/repos/yochiyochirb/kajaeru/forks","keys_url":"https://api.github.com/repos/yochiyochirb/kajaeru/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yochiyochirb/kajaeru/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yochiyochirb/kajaeru/teams","hooks_url":"https://api.github.com/repos/yochiyochirb/kajaeru/hooks","issue_events_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/events{/number}","events_url":"https://api.github.com/repos/yochiyochirb/kajaeru/events","assignees_url":"https://api.github.com/repos/yochiyochirb/kajaeru/assignees{/user}","branches_url":"https://api.github.com/repos/yochiyochirb/kajaeru/branches{/branch}","tags_url":"https://api.github.com/repos/yochiyochirb/kajaeru/tags","blobs_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/refs{/sha}","trees_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yochiyochirb/kajaeru/statuses/{sha}","languages_url":"https://api.github.com/repos/yochiyochirb/kajaeru/languages","stargazers_url":"https://api.github.com/repos/yochiyochirb/kajaeru/stargazers","contributors_url":"https://api.github.com/repos/yochiyochirb/kajaeru/contributors","subscribers_url":"https://api.github.com/repos/yochiyochirb/kajaeru/subscribers","subscription_url":"https://api.github.com/repos/yochiyochirb/kajaeru/subscription","commits_url":"https://api.github.com/repos/yochiyochirb/kajaeru/commits{/sha}","git_commits_url":"https://api.github.com/repos/yochiyochirb/kajaeru/git/commits{/sha}","comments_url":"https://api.github.com/repos/yochiyochirb/kajaeru/comments{/number}","issue_comment_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/comments{/number}","contents_url":"https://api.github.com/repos/yochiyochirb/kajaeru/contents/{+path}","compare_url":"https://api.github.com/repos/yochiyochirb/kajaeru/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yochiyochirb/kajaeru/merges","archive_url":"https://api.github.com/repos/yochiyochirb/kajaeru/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yochiyochirb/kajaeru/downloads","issues_url":"https://api.github.com/repos/yochiyochirb/kajaeru/issues{/number}","pulls_url":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls{/number}","milestones_url":"https://api.github.com/repos/yochiyochirb/kajaeru/milestones{/number}","notifications_url":"https://api.github.com/repos/yochiyochirb/kajaeru/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yochiyochirb/kajaeru/labels{/name}","releases_url":"https://api.github.com/repos/yochiyochirb/kajaeru/releases{/id}","deployments_url":"https://api.github.com/repos/yochiyochirb/kajaeru/deployments","created_at":"2014-08-01T13:29:32Z","updated_at":"2016-03-10T13:58:29Z","pushed_at":"2016-04-17T14:23:37Z","git_url":"git://github.com/yochiyochirb/kajaeru.git","ssh_url":"git@github.com:yochiyochirb/kajaeru.git","clone_url":"https://github.com/yochiyochirb/kajaeru.git","svn_url":"https://github.com/yochiyochirb/kajaeru","homepage":null,"size":393,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":19,"forks":3,"open_issues":19,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/163"},"html":{"href":"https://github.com/yochiyochirb/kajaeru/pull/163"},"issue":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/163"},"comments":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/issues/163/comments"},"review_comments":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/163/comments"},"review_comment":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/pulls/163/commits"},"statuses":{"href":"https://api.github.com/repos/yochiyochirb/kajaeru/statuses/6b2da4c25e2f7df7bc07e87616efe655bb01cb60"}}}}