{"action":"created","comment":{"url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls/comments/82823632","pull_request_review_id":3703710,"id":82823632,"diff_hunk":"@@ -50,13 +51,41 @@ def destroy\n     end\n   end\n \n+  def join\n+  end\n+\n+  def create_join\n+    @event = Event.find_by_join_code(params[:join_code])\n+    if @event.present?\n+      cookies.permanent.encrypted[:join_cookie] = @event.join_code\n+      redirect_to @event\n+    else\n+      render :join\n+    end\n+  end\n+\n   private\n     def set_event\n-      @event = Event.find(params[:id])\n+      if :id == 'join'\n+        redirect_to /join/\n+      else\n+        @event = Event.find(params[:id])\n+      end\n     end\n \n     # Never trust parameters from the scary internet, only allow the white list through.\n     def event_params\n       params.require(:event).permit(:name, :description)\n     end\n+\n+    def authenticate\n+      unless can_view?\n+        redirect_to root_path\n+      end\n+    end\n+\n+    def can_view?\n+      (current_user.present? and @event.user == current_user) || ","path":"app/controllers/events_controller.rb","position":53,"original_position":53,"commit_id":"c31ce4664a19a24b87fc4bc003636fd2d3f32bb9","original_commit_id":"c31ce4664a19a24b87fc4bc003636fd2d3f32bb9","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Use && instead of and.<br>Trailing whitespace detected.","created_at":"2016-10-11T15:44:40Z","updated_at":"2016-10-11T15:44:40Z","html_url":"https://github.com/Play-This-For-Us/playthisforus/pull/39#discussion_r82823632","pull_request_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls/comments/82823632"},"html":{"href":"https://github.com/Play-This-For-Us/playthisforus/pull/39#discussion_r82823632"},"pull_request":{"href":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls/39","id":88850435,"html_url":"https://github.com/Play-This-For-Us/playthisforus/pull/39","diff_url":"https://github.com/Play-This-For-Us/playthisforus/pull/39.diff","patch_url":"https://github.com/Play-This-For-Us/playthisforus/pull/39.patch","issue_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/issues/39","number":39,"state":"open","locked":false,"title":"Event Join","user":{"login":"Skovy","id":5247455,"avatar_url":"https://avatars.githubusercontent.com/u/5247455?v=3","gravatar_id":"","url":"https://api.github.com/users/Skovy","html_url":"https://github.com/Skovy","followers_url":"https://api.github.com/users/Skovy/followers","following_url":"https://api.github.com/users/Skovy/following{/other_user}","gists_url":"https://api.github.com/users/Skovy/gists{/gist_id}","starred_url":"https://api.github.com/users/Skovy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skovy/subscriptions","organizations_url":"https://api.github.com/users/Skovy/orgs","repos_url":"https://api.github.com/users/Skovy/repos","events_url":"https://api.github.com/users/Skovy/events{/privacy}","received_events_url":"https://api.github.com/users/Skovy/received_events","type":"User","site_admin":false},"body":"- Add the ability for guests to join an event use the event code.\r\n- Add basic authentication to events.\r\n- Save the join cookie encrypted so users don't have to rejoin","created_at":"2016-10-11T15:06:03Z","updated_at":"2016-10-11T15:44:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"863c34d6bece1fa805219df28be7aecdc3cc224e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls/39/commits","review_comments_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls/39/comments","review_comment_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/issues/39/comments","statuses_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/statuses/c31ce4664a19a24b87fc4bc003636fd2d3f32bb9","head":{"label":"Play-This-For-Us:join","ref":"join","sha":"c31ce4664a19a24b87fc4bc003636fd2d3f32bb9","user":{"login":"Play-This-For-Us","id":22351059,"avatar_url":"https://avatars.githubusercontent.com/u/22351059?v=3","gravatar_id":"","url":"https://api.github.com/users/Play-This-For-Us","html_url":"https://github.com/Play-This-For-Us","followers_url":"https://api.github.com/users/Play-This-For-Us/followers","following_url":"https://api.github.com/users/Play-This-For-Us/following{/other_user}","gists_url":"https://api.github.com/users/Play-This-For-Us/gists{/gist_id}","starred_url":"https://api.github.com/users/Play-This-For-Us/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Play-This-For-Us/subscriptions","organizations_url":"https://api.github.com/users/Play-This-For-Us/orgs","repos_url":"https://api.github.com/users/Play-This-For-Us/repos","events_url":"https://api.github.com/users/Play-This-For-Us/events{/privacy}","received_events_url":"https://api.github.com/users/Play-This-For-Us/received_events","type":"Organization","site_admin":false},"repo":{"id":68837934,"name":"playthisforus","full_name":"Play-This-For-Us/playthisforus","owner":{"login":"Play-This-For-Us","id":22351059,"avatar_url":"https://avatars.githubusercontent.com/u/22351059?v=3","gravatar_id":"","url":"https://api.github.com/users/Play-This-For-Us","html_url":"https://github.com/Play-This-For-Us","followers_url":"https://api.github.com/users/Play-This-For-Us/followers","following_url":"https://api.github.com/users/Play-This-For-Us/following{/other_user}","gists_url":"https://api.github.com/users/Play-This-For-Us/gists{/gist_id}","starred_url":"https://api.github.com/users/Play-This-For-Us/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Play-This-For-Us/subscriptions","organizations_url":"https://api.github.com/users/Play-This-For-Us/orgs","repos_url":"https://api.github.com/users/Play-This-For-Us/repos","events_url":"https://api.github.com/users/Play-This-For-Us/events{/privacy}","received_events_url":"https://api.github.com/users/Play-This-For-Us/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Play-This-For-Us/playthisforus","description":null,"fork":false,"url":"https://api.github.com/repos/Play-This-For-Us/playthisforus","forks_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/forks","keys_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/teams","hooks_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/hooks","issue_events_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/issues/events{/number}","events_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/events","assignees_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/assignees{/user}","branches_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/branches{/branch}","tags_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/tags","blobs_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/git/refs{/sha}","trees_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/statuses/{sha}","languages_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/languages","stargazers_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/stargazers","contributors_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/contributors","subscribers_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/subscribers","subscription_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/subscription","commits_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/commits{/sha}","git_commits_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/git/commits{/sha}","comments_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/comments{/number}","issue_comment_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/issues/comments{/number}","contents_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/contents/{+path}","compare_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/merges","archive_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/downloads","issues_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/issues{/number}","pulls_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls{/number}","milestones_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/milestones{/number}","notifications_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/labels{/name}","releases_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/releases{/id}","deployments_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/deployments","created_at":"2016-09-21T16:48:23Z","updated_at":"2016-09-21T17:07:59Z","pushed_at":"2016-10-11T15:44:29Z","git_url":"git://github.com/Play-This-For-Us/playthisforus.git","ssh_url":"git@github.com:Play-This-For-Us/playthisforus.git","clone_url":"https://github.com/Play-This-For-Us/playthisforus.git","svn_url":"https://github.com/Play-This-For-Us/playthisforus","homepage":null,"size":25319,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":16,"forks":0,"open_issues":16,"watchers":1,"default_branch":"master"}},"base":{"label":"Play-This-For-Us:master","ref":"master","sha":"0e7f01259f7396b8f9423494ba0c5fa6a548d93a","user":{"login":"Play-This-For-Us","id":22351059,"avatar_url":"https://avatars.githubusercontent.com/u/22351059?v=3","gravatar_id":"","url":"https://api.github.com/users/Play-This-For-Us","html_url":"https://github.com/Play-This-For-Us","followers_url":"https://api.github.com/users/Play-This-For-Us/followers","following_url":"https://api.github.com/users/Play-This-For-Us/following{/other_user}","gists_url":"https://api.github.com/users/Play-This-For-Us/gists{/gist_id}","starred_url":"https://api.github.com/users/Play-This-For-Us/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Play-This-For-Us/subscriptions","organizations_url":"https://api.github.com/users/Play-This-For-Us/orgs","repos_url":"https://api.github.com/users/Play-This-For-Us/repos","events_url":"https://api.github.com/users/Play-This-For-Us/events{/privacy}","received_events_url":"https://api.github.com/users/Play-This-For-Us/received_events","type":"Organization","site_admin":false},"repo":{"id":68837934,"name":"playthisforus","full_name":"Play-This-For-Us/playthisforus","owner":{"login":"Play-This-For-Us","id":22351059,"avatar_url":"https://avatars.githubusercontent.com/u/22351059?v=3","gravatar_id":"","url":"https://api.github.com/users/Play-This-For-Us","html_url":"https://github.com/Play-This-For-Us","followers_url":"https://api.github.com/users/Play-This-For-Us/followers","following_url":"https://api.github.com/users/Play-This-For-Us/following{/other_user}","gists_url":"https://api.github.com/users/Play-This-For-Us/gists{/gist_id}","starred_url":"https://api.github.com/users/Play-This-For-Us/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Play-This-For-Us/subscriptions","organizations_url":"https://api.github.com/users/Play-This-For-Us/orgs","repos_url":"https://api.github.com/users/Play-This-For-Us/repos","events_url":"https://api.github.com/users/Play-This-For-Us/events{/privacy}","received_events_url":"https://api.github.com/users/Play-This-For-Us/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Play-This-For-Us/playthisforus","description":null,"fork":false,"url":"https://api.github.com/repos/Play-This-For-Us/playthisforus","forks_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/forks","keys_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/teams","hooks_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/hooks","issue_events_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/issues/events{/number}","events_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/events","assignees_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/assignees{/user}","branches_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/branches{/branch}","tags_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/tags","blobs_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/git/refs{/sha}","trees_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/statuses/{sha}","languages_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/languages","stargazers_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/stargazers","contributors_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/contributors","subscribers_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/subscribers","subscription_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/subscription","commits_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/commits{/sha}","git_commits_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/git/commits{/sha}","comments_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/comments{/number}","issue_comment_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/issues/comments{/number}","contents_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/contents/{+path}","compare_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/merges","archive_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/downloads","issues_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/issues{/number}","pulls_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls{/number}","milestones_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/milestones{/number}","notifications_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/labels{/name}","releases_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/releases{/id}","deployments_url":"https://api.github.com/repos/Play-This-For-Us/playthisforus/deployments","created_at":"2016-09-21T16:48:23Z","updated_at":"2016-09-21T17:07:59Z","pushed_at":"2016-10-11T15:44:29Z","git_url":"git://github.com/Play-This-For-Us/playthisforus.git","ssh_url":"git@github.com:Play-This-For-Us/playthisforus.git","clone_url":"https://github.com/Play-This-For-Us/playthisforus.git","svn_url":"https://github.com/Play-This-For-Us/playthisforus","homepage":null,"size":25319,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":16,"forks":0,"open_issues":16,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls/39"},"html":{"href":"https://github.com/Play-This-For-Us/playthisforus/pull/39"},"issue":{"href":"https://api.github.com/repos/Play-This-For-Us/playthisforus/issues/39"},"comments":{"href":"https://api.github.com/repos/Play-This-For-Us/playthisforus/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Play-This-For-Us/playthisforus/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/Play-This-For-Us/playthisforus/statuses/c31ce4664a19a24b87fc4bc003636fd2d3f32bb9"}}}}
{"actor":{"display_login":"houndci-bot"}}