{"action":"created","comment":{"url":"https://api.github.com/repos/hackschoolcn/hackschool/pulls/comments/75607142","id":75607142,"diff_hunk":"@@ -1,9 +1,69 @@\n class Account::PostsController < ApplicationController\n+\n   before_action :authenticate_user!\n   before_action :check_subscription_expiration\n \n   def show\n+    @chapter = Chapter.find(params[:chapter_id])\n+    @post = Post.find(params[:id])\n+\n+    if @post.is_hidden || @chapter.is_hidden\n+      flash[:warning] = \"The content is archived\"\n+      redirect_to root_path\n+    end\n+  end\n+\n+\n+  def prev\n+    @post = Post.find(params[:id])\n+    course = @post.course","path":"app/controllers/account/posts_controller.rb","position":19,"original_position":19,"commit_id":"1848cc0cb2c7c9881cb9c6bb76105dca11985fab","original_commit_id":"1848cc0cb2c7c9881cb9c6bb76105dca11985fab","user":{"login":"xdite","id":9004,"avatar_url":"https://avatars.githubusercontent.com/u/9004?v=3","gravatar_id":"","url":"https://api.github.com/users/xdite","html_url":"https://github.com/xdite","followers_url":"https://api.github.com/users/xdite/followers","following_url":"https://api.github.com/users/xdite/following{/other_user}","gists_url":"https://api.github.com/users/xdite/gists{/gist_id}","starred_url":"https://api.github.com/users/xdite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xdite/subscriptions","organizations_url":"https://api.github.com/users/xdite/orgs","repos_url":"https://api.github.com/users/xdite/repos","events_url":"https://api.github.com/users/xdite/events{/privacy}","received_events_url":"https://api.github.com/users/xdite/received_events","type":"User","site_admin":false},"body":"please refactor to model \r\n","created_at":"2016-08-22T00:35:58Z","updated_at":"2016-08-22T00:35:58Z","html_url":"https://github.com/hackschoolcn/hackschool/pull/31#discussion_r75607142","pull_request_url":"https://api.github.com/repos/hackschoolcn/hackschool/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/hackschoolcn/hackschool/pulls/comments/75607142"},"html":{"href":"https://github.com/hackschoolcn/hackschool/pull/31#discussion_r75607142"},"pull_request":{"href":"https://api.github.com/repos/hackschoolcn/hackschool/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/hackschoolcn/hackschool/pulls/31","id":82092179,"html_url":"https://github.com/hackschoolcn/hackschool/pull/31","diff_url":"https://github.com/hackschoolcn/hackschool/pull/31.diff","patch_url":"https://github.com/hackschoolcn/hackschool/pull/31.patch","issue_url":"https://api.github.com/repos/hackschoolcn/hackschool/issues/31","number":31,"state":"open","locked":false,"title":"管理员隐藏发布章节功能，用户 Post 页面翻页功能，建立 seed.rb 测试文档","user":{"login":"chpwang","id":4434868,"avatar_url":"https://avatars.githubusercontent.com/u/4434868?v=3","gravatar_id":"","url":"https://api.github.com/users/chpwang","html_url":"https://github.com/chpwang","followers_url":"https://api.github.com/users/chpwang/followers","following_url":"https://api.github.com/users/chpwang/following{/other_user}","gists_url":"https://api.github.com/users/chpwang/gists{/gist_id}","starred_url":"https://api.github.com/users/chpwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chpwang/subscriptions","organizations_url":"https://api.github.com/users/chpwang/orgs","repos_url":"https://api.github.com/users/chpwang/repos","events_url":"https://api.github.com/users/chpwang/events{/privacy}","received_events_url":"https://api.github.com/users/chpwang/received_events","type":"User","site_admin":false},"body":"目前解决了 issue #28 - 建立 seed.rb 测试文档","created_at":"2016-08-20T23:15:01Z","updated_at":"2016-08-22T00:35:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c12749c03b83dea868ff2e708946155345e88af1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hackschoolcn/hackschool/pulls/31/commits","review_comments_url":"https://api.github.com/repos/hackschoolcn/hackschool/pulls/31/comments","review_comment_url":"https://api.github.com/repos/hackschoolcn/hackschool/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hackschoolcn/hackschool/issues/31/comments","statuses_url":"https://api.github.com/repos/hackschoolcn/hackschool/statuses/1848cc0cb2c7c9881cb9c6bb76105dca11985fab","head":{"label":"hackschoolcn:chpwang-hide-publish-chapters-posts","ref":"chpwang-hide-publish-chapters-posts","sha":"1848cc0cb2c7c9881cb9c6bb76105dca11985fab","user":{"login":"hackschoolcn","id":21052298,"avatar_url":"https://avatars.githubusercontent.com/u/21052298?v=3","gravatar_id":"","url":"https://api.github.com/users/hackschoolcn","html_url":"https://github.com/hackschoolcn","followers_url":"https://api.github.com/users/hackschoolcn/followers","following_url":"https://api.github.com/users/hackschoolcn/following{/other_user}","gists_url":"https://api.github.com/users/hackschoolcn/gists{/gist_id}","starred_url":"https://api.github.com/users/hackschoolcn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackschoolcn/subscriptions","organizations_url":"https://api.github.com/users/hackschoolcn/orgs","repos_url":"https://api.github.com/users/hackschoolcn/repos","events_url":"https://api.github.com/users/hackschoolcn/events{/privacy}","received_events_url":"https://api.github.com/users/hackschoolcn/received_events","type":"Organization","site_admin":false},"repo":{"id":65790674,"name":"hackschool","full_name":"hackschoolcn/hackschool","owner":{"login":"hackschoolcn","id":21052298,"avatar_url":"https://avatars.githubusercontent.com/u/21052298?v=3","gravatar_id":"","url":"https://api.github.com/users/hackschoolcn","html_url":"https://github.com/hackschoolcn","followers_url":"https://api.github.com/users/hackschoolcn/followers","following_url":"https://api.github.com/users/hackschoolcn/following{/other_user}","gists_url":"https://api.github.com/users/hackschoolcn/gists{/gist_id}","starred_url":"https://api.github.com/users/hackschoolcn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackschoolcn/subscriptions","organizations_url":"https://api.github.com/users/hackschoolcn/orgs","repos_url":"https://api.github.com/users/hackschoolcn/repos","events_url":"https://api.github.com/users/hackschoolcn/events{/privacy}","received_events_url":"https://api.github.com/users/hackschoolcn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hackschoolcn/hackschool","description":null,"fork":false,"url":"https://api.github.com/repos/hackschoolcn/hackschool","forks_url":"https://api.github.com/repos/hackschoolcn/hackschool/forks","keys_url":"https://api.github.com/repos/hackschoolcn/hackschool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hackschoolcn/hackschool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hackschoolcn/hackschool/teams","hooks_url":"https://api.github.com/repos/hackschoolcn/hackschool/hooks","issue_events_url":"https://api.github.com/repos/hackschoolcn/hackschool/issues/events{/number}","events_url":"https://api.github.com/repos/hackschoolcn/hackschool/events","assignees_url":"https://api.github.com/repos/hackschoolcn/hackschool/assignees{/user}","branches_url":"https://api.github.com/repos/hackschoolcn/hackschool/branches{/branch}","tags_url":"https://api.github.com/repos/hackschoolcn/hackschool/tags","blobs_url":"https://api.github.com/repos/hackschoolcn/hackschool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hackschoolcn/hackschool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hackschoolcn/hackschool/git/refs{/sha}","trees_url":"https://api.github.com/repos/hackschoolcn/hackschool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hackschoolcn/hackschool/statuses/{sha}","languages_url":"https://api.github.com/repos/hackschoolcn/hackschool/languages","stargazers_url":"https://api.github.com/repos/hackschoolcn/hackschool/stargazers","contributors_url":"https://api.github.com/repos/hackschoolcn/hackschool/contributors","subscribers_url":"https://api.github.com/repos/hackschoolcn/hackschool/subscribers","subscription_url":"https://api.github.com/repos/hackschoolcn/hackschool/subscription","commits_url":"https://api.github.com/repos/hackschoolcn/hackschool/commits{/sha}","git_commits_url":"https://api.github.com/repos/hackschoolcn/hackschool/git/commits{/sha}","comments_url":"https://api.github.com/repos/hackschoolcn/hackschool/comments{/number}","issue_comment_url":"https://api.github.com/repos/hackschoolcn/hackschool/issues/comments{/number}","contents_url":"https://api.github.com/repos/hackschoolcn/hackschool/contents/{+path}","compare_url":"https://api.github.com/repos/hackschoolcn/hackschool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hackschoolcn/hackschool/merges","archive_url":"https://api.github.com/repos/hackschoolcn/hackschool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hackschoolcn/hackschool/downloads","issues_url":"https://api.github.com/repos/hackschoolcn/hackschool/issues{/number}","pulls_url":"https://api.github.com/repos/hackschoolcn/hackschool/pulls{/number}","milestones_url":"https://api.github.com/repos/hackschoolcn/hackschool/milestones{/number}","notifications_url":"https://api.github.com/repos/hackschoolcn/hackschool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hackschoolcn/hackschool/labels{/name}","releases_url":"https://api.github.com/repos/hackschoolcn/hackschool/releases{/id}","deployments_url":"https://api.github.com/repos/hackschoolcn/hackschool/deployments","created_at":"2016-08-16T05:41:07Z","updated_at":"2016-08-16T05:55:30Z","pushed_at":"2016-08-22T00:30:35Z","git_url":"git://github.com/hackschoolcn/hackschool.git","ssh_url":"git@github.com:hackschoolcn/hackschool.git","clone_url":"https://github.com/hackschoolcn/hackschool.git","svn_url":"https://github.com/hackschoolcn/hackschool","homepage":null,"size":456,"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":10,"forks":0,"open_issues":10,"watchers":0,"default_branch":"master"}},"base":{"label":"hackschoolcn:develop","ref":"develop","sha":"aab82b1b55dbea4d6c8faa59612b33dde8e3c7aa","user":{"login":"hackschoolcn","id":21052298,"avatar_url":"https://avatars.githubusercontent.com/u/21052298?v=3","gravatar_id":"","url":"https://api.github.com/users/hackschoolcn","html_url":"https://github.com/hackschoolcn","followers_url":"https://api.github.com/users/hackschoolcn/followers","following_url":"https://api.github.com/users/hackschoolcn/following{/other_user}","gists_url":"https://api.github.com/users/hackschoolcn/gists{/gist_id}","starred_url":"https://api.github.com/users/hackschoolcn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackschoolcn/subscriptions","organizations_url":"https://api.github.com/users/hackschoolcn/orgs","repos_url":"https://api.github.com/users/hackschoolcn/repos","events_url":"https://api.github.com/users/hackschoolcn/events{/privacy}","received_events_url":"https://api.github.com/users/hackschoolcn/received_events","type":"Organization","site_admin":false},"repo":{"id":65790674,"name":"hackschool","full_name":"hackschoolcn/hackschool","owner":{"login":"hackschoolcn","id":21052298,"avatar_url":"https://avatars.githubusercontent.com/u/21052298?v=3","gravatar_id":"","url":"https://api.github.com/users/hackschoolcn","html_url":"https://github.com/hackschoolcn","followers_url":"https://api.github.com/users/hackschoolcn/followers","following_url":"https://api.github.com/users/hackschoolcn/following{/other_user}","gists_url":"https://api.github.com/users/hackschoolcn/gists{/gist_id}","starred_url":"https://api.github.com/users/hackschoolcn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackschoolcn/subscriptions","organizations_url":"https://api.github.com/users/hackschoolcn/orgs","repos_url":"https://api.github.com/users/hackschoolcn/repos","events_url":"https://api.github.com/users/hackschoolcn/events{/privacy}","received_events_url":"https://api.github.com/users/hackschoolcn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hackschoolcn/hackschool","description":null,"fork":false,"url":"https://api.github.com/repos/hackschoolcn/hackschool","forks_url":"https://api.github.com/repos/hackschoolcn/hackschool/forks","keys_url":"https://api.github.com/repos/hackschoolcn/hackschool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hackschoolcn/hackschool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hackschoolcn/hackschool/teams","hooks_url":"https://api.github.com/repos/hackschoolcn/hackschool/hooks","issue_events_url":"https://api.github.com/repos/hackschoolcn/hackschool/issues/events{/number}","events_url":"https://api.github.com/repos/hackschoolcn/hackschool/events","assignees_url":"https://api.github.com/repos/hackschoolcn/hackschool/assignees{/user}","branches_url":"https://api.github.com/repos/hackschoolcn/hackschool/branches{/branch}","tags_url":"https://api.github.com/repos/hackschoolcn/hackschool/tags","blobs_url":"https://api.github.com/repos/hackschoolcn/hackschool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hackschoolcn/hackschool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hackschoolcn/hackschool/git/refs{/sha}","trees_url":"https://api.github.com/repos/hackschoolcn/hackschool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hackschoolcn/hackschool/statuses/{sha}","languages_url":"https://api.github.com/repos/hackschoolcn/hackschool/languages","stargazers_url":"https://api.github.com/repos/hackschoolcn/hackschool/stargazers","contributors_url":"https://api.github.com/repos/hackschoolcn/hackschool/contributors","subscribers_url":"https://api.github.com/repos/hackschoolcn/hackschool/subscribers","subscription_url":"https://api.github.com/repos/hackschoolcn/hackschool/subscription","commits_url":"https://api.github.com/repos/hackschoolcn/hackschool/commits{/sha}","git_commits_url":"https://api.github.com/repos/hackschoolcn/hackschool/git/commits{/sha}","comments_url":"https://api.github.com/repos/hackschoolcn/hackschool/comments{/number}","issue_comment_url":"https://api.github.com/repos/hackschoolcn/hackschool/issues/comments{/number}","contents_url":"https://api.github.com/repos/hackschoolcn/hackschool/contents/{+path}","compare_url":"https://api.github.com/repos/hackschoolcn/hackschool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hackschoolcn/hackschool/merges","archive_url":"https://api.github.com/repos/hackschoolcn/hackschool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hackschoolcn/hackschool/downloads","issues_url":"https://api.github.com/repos/hackschoolcn/hackschool/issues{/number}","pulls_url":"https://api.github.com/repos/hackschoolcn/hackschool/pulls{/number}","milestones_url":"https://api.github.com/repos/hackschoolcn/hackschool/milestones{/number}","notifications_url":"https://api.github.com/repos/hackschoolcn/hackschool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hackschoolcn/hackschool/labels{/name}","releases_url":"https://api.github.com/repos/hackschoolcn/hackschool/releases{/id}","deployments_url":"https://api.github.com/repos/hackschoolcn/hackschool/deployments","created_at":"2016-08-16T05:41:07Z","updated_at":"2016-08-16T05:55:30Z","pushed_at":"2016-08-22T00:30:35Z","git_url":"git://github.com/hackschoolcn/hackschool.git","ssh_url":"git@github.com:hackschoolcn/hackschool.git","clone_url":"https://github.com/hackschoolcn/hackschool.git","svn_url":"https://github.com/hackschoolcn/hackschool","homepage":null,"size":456,"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":10,"forks":0,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hackschoolcn/hackschool/pulls/31"},"html":{"href":"https://github.com/hackschoolcn/hackschool/pull/31"},"issue":{"href":"https://api.github.com/repos/hackschoolcn/hackschool/issues/31"},"comments":{"href":"https://api.github.com/repos/hackschoolcn/hackschool/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/hackschoolcn/hackschool/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/hackschoolcn/hackschool/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hackschoolcn/hackschool/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/hackschoolcn/hackschool/statuses/1848cc0cb2c7c9881cb9c6bb76105dca11985fab"}}}}
{"actor":{"display_login":"xdite"}}