{"action":"created","comment":{"url":"https://api.github.com/repos/mysociety/remit/pulls/comments/51603142","id":51603142,"diff_hunk":"@@ -0,0 +1,19 @@\n+class DocumentsController < ApplicationController\n+  def create\n+    @study = Study.find(params[:study_id])\n+    @document = Document.new(document_params)\n+    @document.study = @study\n+    if @document.save\n+      redirect_to @study, notice: \"Document created successfully\"\n+    else\n+      flash[:alert] = \"Sorry, looks like we're missing something, can you double check?\"","path":"app/controllers/documents_controller.rb","position":9,"original_position":9,"commit_id":"fa76b38d0697c7bf9fb782135be6b0e97088daac","original_commit_id":"fa76b38d0697c7bf9fb782135be6b0e97088daac","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [88/80]","created_at":"2016-02-02T17:31:09Z","updated_at":"2016-02-02T17:31:09Z","html_url":"https://github.com/mysociety/remit/pull/80#discussion_r51603142","pull_request_url":"https://api.github.com/repos/mysociety/remit/pulls/80","_links":{"self":{"href":"https://api.github.com/repos/mysociety/remit/pulls/comments/51603142"},"html":{"href":"https://github.com/mysociety/remit/pull/80#discussion_r51603142"},"pull_request":{"href":"https://api.github.com/repos/mysociety/remit/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/mysociety/remit/pulls/80","id":58020943,"html_url":"https://github.com/mysociety/remit/pull/80","diff_url":"https://github.com/mysociety/remit/pull/80.diff","patch_url":"https://github.com/mysociety/remit/pull/80.patch","issue_url":"https://api.github.com/repos/mysociety/remit/issues/80","number":80,"state":"open","locked":false,"title":"Adding Enablers/Barriers from study page","user":{"login":"stevenday","id":663700,"avatar_url":"https://avatars.githubusercontent.com/u/663700?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenday","html_url":"https://github.com/stevenday","followers_url":"https://api.github.com/users/stevenday/followers","following_url":"https://api.github.com/users/stevenday/following{/other_user}","gists_url":"https://api.github.com/users/stevenday/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenday/subscriptions","organizations_url":"https://api.github.com/users/stevenday/orgs","repos_url":"https://api.github.com/users/stevenday/repos","events_url":"https://api.github.com/users/stevenday/events{/privacy}","received_events_url":"https://api.github.com/users/stevenday/received_events","type":"User","site_admin":false},"body":"This takes @zarino's work from #77 and wires up the forms to create\nenablers/barriers from the study page. With some refactoring of existing\ncontrollers that do similar things for StudyImpacts so that code and tests\ncan be shared a little.\n\nCloses #60","created_at":"2016-02-02T17:30:42Z","updated_at":"2016-02-02T17:31:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mysociety/remit/pulls/80/commits","review_comments_url":"https://api.github.com/repos/mysociety/remit/pulls/80/comments","review_comment_url":"https://api.github.com/repos/mysociety/remit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mysociety/remit/issues/80/comments","statuses_url":"https://api.github.com/repos/mysociety/remit/statuses/fa76b38d0697c7bf9fb782135be6b0e97088daac","head":{"label":"mysociety:60-enablers-barriers","ref":"60-enablers-barriers","sha":"fa76b38d0697c7bf9fb782135be6b0e97088daac","user":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"repo":{"id":48167850,"name":"remit","full_name":"mysociety/remit","owner":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysociety/remit","description":"Research Management Information Tool (ReMIT) for Médecins Sans Frontieres' Manson Unit","fork":false,"url":"https://api.github.com/repos/mysociety/remit","forks_url":"https://api.github.com/repos/mysociety/remit/forks","keys_url":"https://api.github.com/repos/mysociety/remit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysociety/remit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysociety/remit/teams","hooks_url":"https://api.github.com/repos/mysociety/remit/hooks","issue_events_url":"https://api.github.com/repos/mysociety/remit/issues/events{/number}","events_url":"https://api.github.com/repos/mysociety/remit/events","assignees_url":"https://api.github.com/repos/mysociety/remit/assignees{/user}","branches_url":"https://api.github.com/repos/mysociety/remit/branches{/branch}","tags_url":"https://api.github.com/repos/mysociety/remit/tags","blobs_url":"https://api.github.com/repos/mysociety/remit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysociety/remit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysociety/remit/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysociety/remit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysociety/remit/statuses/{sha}","languages_url":"https://api.github.com/repos/mysociety/remit/languages","stargazers_url":"https://api.github.com/repos/mysociety/remit/stargazers","contributors_url":"https://api.github.com/repos/mysociety/remit/contributors","subscribers_url":"https://api.github.com/repos/mysociety/remit/subscribers","subscription_url":"https://api.github.com/repos/mysociety/remit/subscription","commits_url":"https://api.github.com/repos/mysociety/remit/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysociety/remit/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysociety/remit/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysociety/remit/issues/comments{/number}","contents_url":"https://api.github.com/repos/mysociety/remit/contents/{+path}","compare_url":"https://api.github.com/repos/mysociety/remit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysociety/remit/merges","archive_url":"https://api.github.com/repos/mysociety/remit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysociety/remit/downloads","issues_url":"https://api.github.com/repos/mysociety/remit/issues{/number}","pulls_url":"https://api.github.com/repos/mysociety/remit/pulls{/number}","milestones_url":"https://api.github.com/repos/mysociety/remit/milestones{/number}","notifications_url":"https://api.github.com/repos/mysociety/remit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysociety/remit/labels{/name}","releases_url":"https://api.github.com/repos/mysociety/remit/releases{/id}","deployments_url":"https://api.github.com/repos/mysociety/remit/deployments","created_at":"2015-12-17T10:23:31Z","updated_at":"2016-01-11T16:28:48Z","pushed_at":"2016-02-02T17:30:43Z","git_url":"git://github.com/mysociety/remit.git","ssh_url":"git@github.com:mysociety/remit.git","clone_url":"https://github.com/mysociety/remit.git","svn_url":"https://github.com/mysociety/remit","homepage":null,"size":372,"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":50,"forks":0,"open_issues":50,"watchers":0,"default_branch":"master"}},"base":{"label":"mysociety:issues/3-creating-documents","ref":"issues/3-creating-documents","sha":"5c179ebe09ce693bff2d513d5cc250e8f69f3793","user":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"repo":{"id":48167850,"name":"remit","full_name":"mysociety/remit","owner":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysociety/remit","description":"Research Management Information Tool (ReMIT) for Médecins Sans Frontieres' Manson Unit","fork":false,"url":"https://api.github.com/repos/mysociety/remit","forks_url":"https://api.github.com/repos/mysociety/remit/forks","keys_url":"https://api.github.com/repos/mysociety/remit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysociety/remit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysociety/remit/teams","hooks_url":"https://api.github.com/repos/mysociety/remit/hooks","issue_events_url":"https://api.github.com/repos/mysociety/remit/issues/events{/number}","events_url":"https://api.github.com/repos/mysociety/remit/events","assignees_url":"https://api.github.com/repos/mysociety/remit/assignees{/user}","branches_url":"https://api.github.com/repos/mysociety/remit/branches{/branch}","tags_url":"https://api.github.com/repos/mysociety/remit/tags","blobs_url":"https://api.github.com/repos/mysociety/remit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysociety/remit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysociety/remit/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysociety/remit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysociety/remit/statuses/{sha}","languages_url":"https://api.github.com/repos/mysociety/remit/languages","stargazers_url":"https://api.github.com/repos/mysociety/remit/stargazers","contributors_url":"https://api.github.com/repos/mysociety/remit/contributors","subscribers_url":"https://api.github.com/repos/mysociety/remit/subscribers","subscription_url":"https://api.github.com/repos/mysociety/remit/subscription","commits_url":"https://api.github.com/repos/mysociety/remit/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysociety/remit/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysociety/remit/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysociety/remit/issues/comments{/number}","contents_url":"https://api.github.com/repos/mysociety/remit/contents/{+path}","compare_url":"https://api.github.com/repos/mysociety/remit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysociety/remit/merges","archive_url":"https://api.github.com/repos/mysociety/remit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysociety/remit/downloads","issues_url":"https://api.github.com/repos/mysociety/remit/issues{/number}","pulls_url":"https://api.github.com/repos/mysociety/remit/pulls{/number}","milestones_url":"https://api.github.com/repos/mysociety/remit/milestones{/number}","notifications_url":"https://api.github.com/repos/mysociety/remit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysociety/remit/labels{/name}","releases_url":"https://api.github.com/repos/mysociety/remit/releases{/id}","deployments_url":"https://api.github.com/repos/mysociety/remit/deployments","created_at":"2015-12-17T10:23:31Z","updated_at":"2016-01-11T16:28:48Z","pushed_at":"2016-02-02T17:30:43Z","git_url":"git://github.com/mysociety/remit.git","ssh_url":"git@github.com:mysociety/remit.git","clone_url":"https://github.com/mysociety/remit.git","svn_url":"https://github.com/mysociety/remit","homepage":null,"size":372,"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":50,"forks":0,"open_issues":50,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mysociety/remit/pulls/80"},"html":{"href":"https://github.com/mysociety/remit/pull/80"},"issue":{"href":"https://api.github.com/repos/mysociety/remit/issues/80"},"comments":{"href":"https://api.github.com/repos/mysociety/remit/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/mysociety/remit/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/mysociety/remit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mysociety/remit/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/mysociety/remit/statuses/fa76b38d0697c7bf9fb782135be6b0e97088daac"}}}}