{"action":"created","comment":{"url":"https://api.github.com/repos/CruGlobal/measurements-api/pulls/comments/56706190","id":56706190,"diff_hunk":"@@ -0,0 +1,93 @@\n+module V5\n+  class StoriesController < V5::BaseUserController\n+    power :stories, map: {\n+      [:show] => :show_stories,\n+      [:update] => :update_stories,\n+      [:create] => :create_story\n+    }, as: :story_scope\n+\n+    def index\n+      load_stories\n+      render_stories\n+    end\n+\n+    def show\n+      load_story or render_not_found\n+      render_story\n+    end\n+\n+    def create\n+      if build_story\n+        render_story :created\n+      else\n+        render_errors\n+      end\n+    end\n+\n+    def update\n+      load_story or render_error('Invalid story id') && return","path":"app/controllers/v5/stories_controller.rb","position":28,"original_position":28,"commit_id":"883276eb04156e48148b4c8ebdaea29ccc5a4012","original_commit_id":"883276eb04156e48148b4c8ebdaea29ccc5a4012","user":{"login":"twinge","id":23668,"avatar_url":"https://avatars.githubusercontent.com/u/23668?v=3","gravatar_id":"","url":"https://api.github.com/users/twinge","html_url":"https://github.com/twinge","followers_url":"https://api.github.com/users/twinge/followers","following_url":"https://api.github.com/users/twinge/following{/other_user}","gists_url":"https://api.github.com/users/twinge/gists{/gist_id}","starred_url":"https://api.github.com/users/twinge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twinge/subscriptions","organizations_url":"https://api.github.com/users/twinge/orgs","repos_url":"https://api.github.com/users/twinge/repos","events_url":"https://api.github.com/users/twinge/events{/privacy}","received_events_url":"https://api.github.com/users/twinge/received_events","type":"User","site_admin":false},"body":"```\r\nirb(main):008:0> false or true && puts(' world')\r\n world\r\n```","created_at":"2016-03-18T18:59:41Z","updated_at":"2016-03-18T18:59:41Z","html_url":"https://github.com/CruGlobal/measurements-api/pull/19#discussion_r56706190","pull_request_url":"https://api.github.com/repos/CruGlobal/measurements-api/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/CruGlobal/measurements-api/pulls/comments/56706190"},"html":{"href":"https://github.com/CruGlobal/measurements-api/pull/19#discussion_r56706190"},"pull_request":{"href":"https://api.github.com/repos/CruGlobal/measurements-api/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/CruGlobal/measurements-api/pulls/19","id":63393728,"html_url":"https://github.com/CruGlobal/measurements-api/pull/19","diff_url":"https://github.com/CruGlobal/measurements-api/pull/19.diff","patch_url":"https://github.com/CruGlobal/measurements-api/pull/19.patch","issue_url":"https://api.github.com/repos/CruGlobal/measurements-api/issues/19","number":19,"state":"open","locked":false,"title":"Stories and images","user":{"login":"Omicron7","id":302915,"avatar_url":"https://avatars.githubusercontent.com/u/302915?v=3","gravatar_id":"","url":"https://api.github.com/users/Omicron7","html_url":"https://github.com/Omicron7","followers_url":"https://api.github.com/users/Omicron7/followers","following_url":"https://api.github.com/users/Omicron7/following{/other_user}","gists_url":"https://api.github.com/users/Omicron7/gists{/gist_id}","starred_url":"https://api.github.com/users/Omicron7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Omicron7/subscriptions","organizations_url":"https://api.github.com/users/Omicron7/orgs","repos_url":"https://api.github.com/users/Omicron7/repos","events_url":"https://api.github.com/users/Omicron7/events{/privacy}","received_events_url":"https://api.github.com/users/Omicron7/received_events","type":"User","site_admin":false},"body":"Stories endpoints","created_at":"2016-03-18T15:43:27Z","updated_at":"2016-03-18T18:59:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35db9fc7a2e7ea64f9e341b26ff139015dd90894","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CruGlobal/measurements-api/pulls/19/commits","review_comments_url":"https://api.github.com/repos/CruGlobal/measurements-api/pulls/19/comments","review_comment_url":"https://api.github.com/repos/CruGlobal/measurements-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CruGlobal/measurements-api/issues/19/comments","statuses_url":"https://api.github.com/repos/CruGlobal/measurements-api/statuses/883276eb04156e48148b4c8ebdaea29ccc5a4012","head":{"label":"CruGlobal:stories_and_images","ref":"stories_and_images","sha":"883276eb04156e48148b4c8ebdaea29ccc5a4012","user":{"login":"CruGlobal","id":1785912,"avatar_url":"https://avatars.githubusercontent.com/u/1785912?v=3","gravatar_id":"","url":"https://api.github.com/users/CruGlobal","html_url":"https://github.com/CruGlobal","followers_url":"https://api.github.com/users/CruGlobal/followers","following_url":"https://api.github.com/users/CruGlobal/following{/other_user}","gists_url":"https://api.github.com/users/CruGlobal/gists{/gist_id}","starred_url":"https://api.github.com/users/CruGlobal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CruGlobal/subscriptions","organizations_url":"https://api.github.com/users/CruGlobal/orgs","repos_url":"https://api.github.com/users/CruGlobal/repos","events_url":"https://api.github.com/users/CruGlobal/events{/privacy}","received_events_url":"https://api.github.com/users/CruGlobal/received_events","type":"Organization","site_admin":false},"repo":{"id":48752221,"name":"measurements-api","full_name":"CruGlobal/measurements-api","owner":{"login":"CruGlobal","id":1785912,"avatar_url":"https://avatars.githubusercontent.com/u/1785912?v=3","gravatar_id":"","url":"https://api.github.com/users/CruGlobal","html_url":"https://github.com/CruGlobal","followers_url":"https://api.github.com/users/CruGlobal/followers","following_url":"https://api.github.com/users/CruGlobal/following{/other_user}","gists_url":"https://api.github.com/users/CruGlobal/gists{/gist_id}","starred_url":"https://api.github.com/users/CruGlobal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CruGlobal/subscriptions","organizations_url":"https://api.github.com/users/CruGlobal/orgs","repos_url":"https://api.github.com/users/CruGlobal/repos","events_url":"https://api.github.com/users/CruGlobal/events{/privacy}","received_events_url":"https://api.github.com/users/CruGlobal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CruGlobal/measurements-api","description":"Global Measurements Application (GMA) API","fork":false,"url":"https://api.github.com/repos/CruGlobal/measurements-api","forks_url":"https://api.github.com/repos/CruGlobal/measurements-api/forks","keys_url":"https://api.github.com/repos/CruGlobal/measurements-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CruGlobal/measurements-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CruGlobal/measurements-api/teams","hooks_url":"https://api.github.com/repos/CruGlobal/measurements-api/hooks","issue_events_url":"https://api.github.com/repos/CruGlobal/measurements-api/issues/events{/number}","events_url":"https://api.github.com/repos/CruGlobal/measurements-api/events","assignees_url":"https://api.github.com/repos/CruGlobal/measurements-api/assignees{/user}","branches_url":"https://api.github.com/repos/CruGlobal/measurements-api/branches{/branch}","tags_url":"https://api.github.com/repos/CruGlobal/measurements-api/tags","blobs_url":"https://api.github.com/repos/CruGlobal/measurements-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CruGlobal/measurements-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CruGlobal/measurements-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/CruGlobal/measurements-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CruGlobal/measurements-api/statuses/{sha}","languages_url":"https://api.github.com/repos/CruGlobal/measurements-api/languages","stargazers_url":"https://api.github.com/repos/CruGlobal/measurements-api/stargazers","contributors_url":"https://api.github.com/repos/CruGlobal/measurements-api/contributors","subscribers_url":"https://api.github.com/repos/CruGlobal/measurements-api/subscribers","subscription_url":"https://api.github.com/repos/CruGlobal/measurements-api/subscription","commits_url":"https://api.github.com/repos/CruGlobal/measurements-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/CruGlobal/measurements-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/CruGlobal/measurements-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/CruGlobal/measurements-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/CruGlobal/measurements-api/contents/{+path}","compare_url":"https://api.github.com/repos/CruGlobal/measurements-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CruGlobal/measurements-api/merges","archive_url":"https://api.github.com/repos/CruGlobal/measurements-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CruGlobal/measurements-api/downloads","issues_url":"https://api.github.com/repos/CruGlobal/measurements-api/issues{/number}","pulls_url":"https://api.github.com/repos/CruGlobal/measurements-api/pulls{/number}","milestones_url":"https://api.github.com/repos/CruGlobal/measurements-api/milestones{/number}","notifications_url":"https://api.github.com/repos/CruGlobal/measurements-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CruGlobal/measurements-api/labels{/name}","releases_url":"https://api.github.com/repos/CruGlobal/measurements-api/releases{/id}","deployments_url":"https://api.github.com/repos/CruGlobal/measurements-api/deployments","created_at":"2015-12-29T14:54:09Z","updated_at":"2016-03-14T15:56:58Z","pushed_at":"2016-03-18T18:58:54Z","git_url":"git://github.com/CruGlobal/measurements-api.git","ssh_url":"git@github.com:CruGlobal/measurements-api.git","clone_url":"https://github.com/CruGlobal/measurements-api.git","svn_url":"https://github.com/CruGlobal/measurements-api","homepage":null,"size":38328,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":2,"default_branch":"staging"}},"base":{"label":"CruGlobal:staging","ref":"staging","sha":"b71e6ff963eec6d905face193acba2feb183ea83","user":{"login":"CruGlobal","id":1785912,"avatar_url":"https://avatars.githubusercontent.com/u/1785912?v=3","gravatar_id":"","url":"https://api.github.com/users/CruGlobal","html_url":"https://github.com/CruGlobal","followers_url":"https://api.github.com/users/CruGlobal/followers","following_url":"https://api.github.com/users/CruGlobal/following{/other_user}","gists_url":"https://api.github.com/users/CruGlobal/gists{/gist_id}","starred_url":"https://api.github.com/users/CruGlobal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CruGlobal/subscriptions","organizations_url":"https://api.github.com/users/CruGlobal/orgs","repos_url":"https://api.github.com/users/CruGlobal/repos","events_url":"https://api.github.com/users/CruGlobal/events{/privacy}","received_events_url":"https://api.github.com/users/CruGlobal/received_events","type":"Organization","site_admin":false},"repo":{"id":48752221,"name":"measurements-api","full_name":"CruGlobal/measurements-api","owner":{"login":"CruGlobal","id":1785912,"avatar_url":"https://avatars.githubusercontent.com/u/1785912?v=3","gravatar_id":"","url":"https://api.github.com/users/CruGlobal","html_url":"https://github.com/CruGlobal","followers_url":"https://api.github.com/users/CruGlobal/followers","following_url":"https://api.github.com/users/CruGlobal/following{/other_user}","gists_url":"https://api.github.com/users/CruGlobal/gists{/gist_id}","starred_url":"https://api.github.com/users/CruGlobal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CruGlobal/subscriptions","organizations_url":"https://api.github.com/users/CruGlobal/orgs","repos_url":"https://api.github.com/users/CruGlobal/repos","events_url":"https://api.github.com/users/CruGlobal/events{/privacy}","received_events_url":"https://api.github.com/users/CruGlobal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CruGlobal/measurements-api","description":"Global Measurements Application (GMA) API","fork":false,"url":"https://api.github.com/repos/CruGlobal/measurements-api","forks_url":"https://api.github.com/repos/CruGlobal/measurements-api/forks","keys_url":"https://api.github.com/repos/CruGlobal/measurements-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CruGlobal/measurements-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CruGlobal/measurements-api/teams","hooks_url":"https://api.github.com/repos/CruGlobal/measurements-api/hooks","issue_events_url":"https://api.github.com/repos/CruGlobal/measurements-api/issues/events{/number}","events_url":"https://api.github.com/repos/CruGlobal/measurements-api/events","assignees_url":"https://api.github.com/repos/CruGlobal/measurements-api/assignees{/user}","branches_url":"https://api.github.com/repos/CruGlobal/measurements-api/branches{/branch}","tags_url":"https://api.github.com/repos/CruGlobal/measurements-api/tags","blobs_url":"https://api.github.com/repos/CruGlobal/measurements-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CruGlobal/measurements-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CruGlobal/measurements-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/CruGlobal/measurements-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CruGlobal/measurements-api/statuses/{sha}","languages_url":"https://api.github.com/repos/CruGlobal/measurements-api/languages","stargazers_url":"https://api.github.com/repos/CruGlobal/measurements-api/stargazers","contributors_url":"https://api.github.com/repos/CruGlobal/measurements-api/contributors","subscribers_url":"https://api.github.com/repos/CruGlobal/measurements-api/subscribers","subscription_url":"https://api.github.com/repos/CruGlobal/measurements-api/subscription","commits_url":"https://api.github.com/repos/CruGlobal/measurements-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/CruGlobal/measurements-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/CruGlobal/measurements-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/CruGlobal/measurements-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/CruGlobal/measurements-api/contents/{+path}","compare_url":"https://api.github.com/repos/CruGlobal/measurements-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CruGlobal/measurements-api/merges","archive_url":"https://api.github.com/repos/CruGlobal/measurements-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CruGlobal/measurements-api/downloads","issues_url":"https://api.github.com/repos/CruGlobal/measurements-api/issues{/number}","pulls_url":"https://api.github.com/repos/CruGlobal/measurements-api/pulls{/number}","milestones_url":"https://api.github.com/repos/CruGlobal/measurements-api/milestones{/number}","notifications_url":"https://api.github.com/repos/CruGlobal/measurements-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CruGlobal/measurements-api/labels{/name}","releases_url":"https://api.github.com/repos/CruGlobal/measurements-api/releases{/id}","deployments_url":"https://api.github.com/repos/CruGlobal/measurements-api/deployments","created_at":"2015-12-29T14:54:09Z","updated_at":"2016-03-14T15:56:58Z","pushed_at":"2016-03-18T18:58:54Z","git_url":"git://github.com/CruGlobal/measurements-api.git","ssh_url":"git@github.com:CruGlobal/measurements-api.git","clone_url":"https://github.com/CruGlobal/measurements-api.git","svn_url":"https://github.com/CruGlobal/measurements-api","homepage":null,"size":38328,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":2,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/CruGlobal/measurements-api/pulls/19"},"html":{"href":"https://github.com/CruGlobal/measurements-api/pull/19"},"issue":{"href":"https://api.github.com/repos/CruGlobal/measurements-api/issues/19"},"comments":{"href":"https://api.github.com/repos/CruGlobal/measurements-api/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/CruGlobal/measurements-api/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/CruGlobal/measurements-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CruGlobal/measurements-api/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/CruGlobal/measurements-api/statuses/883276eb04156e48148b4c8ebdaea29ccc5a4012"}}}}