{"action":"created","comment":{"url":"https://api.github.com/repos/dmarczal/FARMA/pulls/comments/184696367","pull_request_review_id":115948829,"id":184696367,"diff_hunk":"@@ -0,0 +1,43 @@\n+class Api::QuestionsController < ApplicationController\n+  def index\n+    render json: Question.all\n+  end\n+\n+  def show\n+    question = Question.find_by(id: params[:id])\n+    if question\n+      render json: question\n+    else\n+      render json: {error: \"Question does not exist\"}\n+    end\n+\n+  end\n+\n+  def create\n+    question = Question.new(question_params)\n+\n+    if question.save\n+      render json: {success: \"Question successfully created\"}\n+    else\n+      render json: {error: \"Error creating question\"}\n+    end\n+\n+  end\n+\n+  def update\n+\n+    if Question.update(question_params)\n+      render json: {success: \"Question successfully update\"}","path":"app/controllers/api/questions_controller.rb","position":30,"original_position":30,"commit_id":"f807d79573c24ededa755a47d52c311065814b7f","original_commit_id":"f807d79573c24ededa755a47d52c311065814b7f","user":{"login":"dmarczal","id":484005,"avatar_url":"https://avatars3.githubusercontent.com/u/484005?v=4","gravatar_id":"","url":"https://api.github.com/users/dmarczal","html_url":"https://github.com/dmarczal","followers_url":"https://api.github.com/users/dmarczal/followers","following_url":"https://api.github.com/users/dmarczal/following{/other_user}","gists_url":"https://api.github.com/users/dmarczal/gists{/gist_id}","starred_url":"https://api.github.com/users/dmarczal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmarczal/subscriptions","organizations_url":"https://api.github.com/users/dmarczal/orgs","repos_url":"https://api.github.com/users/dmarczal/repos","events_url":"https://api.github.com/users/dmarczal/events{/privacy}","received_events_url":"https://api.github.com/users/dmarczal/received_events","type":"User","site_admin":false},"body":"Same of the destroy, I can update a question that is not mine. This is not good.","created_at":"2018-04-27T14:02:56Z","updated_at":"2018-04-27T14:02:57Z","html_url":"https://github.com/dmarczal/FARMA/pull/12#discussion_r184696367","pull_request_url":"https://api.github.com/repos/dmarczal/FARMA/pulls/12","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/dmarczal/FARMA/pulls/comments/184696367"},"html":{"href":"https://github.com/dmarczal/FARMA/pull/12#discussion_r184696367"},"pull_request":{"href":"https://api.github.com/repos/dmarczal/FARMA/pulls/12"}},"in_reply_to_id":183740200},"pull_request":{"url":"https://api.github.com/repos/dmarczal/FARMA/pulls/12","id":182242845,"html_url":"https://github.com/dmarczal/FARMA/pull/12","diff_url":"https://github.com/dmarczal/FARMA/pull/12.diff","patch_url":"https://github.com/dmarczal/FARMA/pull/12.patch","issue_url":"https://api.github.com/repos/dmarczal/FARMA/issues/12","number":12,"state":"open","locked":false,"title":"Create CRUD endpoints to questions","user":{"login":"Bartiechen","id":27712455,"avatar_url":"https://avatars3.githubusercontent.com/u/27712455?v=4","gravatar_id":"","url":"https://api.github.com/users/Bartiechen","html_url":"https://github.com/Bartiechen","followers_url":"https://api.github.com/users/Bartiechen/followers","following_url":"https://api.github.com/users/Bartiechen/following{/other_user}","gists_url":"https://api.github.com/users/Bartiechen/gists{/gist_id}","starred_url":"https://api.github.com/users/Bartiechen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bartiechen/subscriptions","organizations_url":"https://api.github.com/users/Bartiechen/orgs","repos_url":"https://api.github.com/users/Bartiechen/repos","events_url":"https://api.github.com/users/Bartiechen/events{/privacy}","received_events_url":"https://api.github.com/users/Bartiechen/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-17T17:40:31Z","updated_at":"2018-04-27T14:02:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ddf0982136f1d0ab063630879276c509a3de4b23","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dmarczal/FARMA/pulls/12/commits","review_comments_url":"https://api.github.com/repos/dmarczal/FARMA/pulls/12/comments","review_comment_url":"https://api.github.com/repos/dmarczal/FARMA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dmarczal/FARMA/issues/12/comments","statuses_url":"https://api.github.com/repos/dmarczal/FARMA/statuses/f807d79573c24ededa755a47d52c311065814b7f","head":{"label":"Bartiechen:end-pointQuestion","ref":"end-pointQuestion","sha":"f807d79573c24ededa755a47d52c311065814b7f","user":{"login":"Bartiechen","id":27712455,"avatar_url":"https://avatars3.githubusercontent.com/u/27712455?v=4","gravatar_id":"","url":"https://api.github.com/users/Bartiechen","html_url":"https://github.com/Bartiechen","followers_url":"https://api.github.com/users/Bartiechen/followers","following_url":"https://api.github.com/users/Bartiechen/following{/other_user}","gists_url":"https://api.github.com/users/Bartiechen/gists{/gist_id}","starred_url":"https://api.github.com/users/Bartiechen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bartiechen/subscriptions","organizations_url":"https://api.github.com/users/Bartiechen/orgs","repos_url":"https://api.github.com/users/Bartiechen/repos","events_url":"https://api.github.com/users/Bartiechen/events{/privacy}","received_events_url":"https://api.github.com/users/Bartiechen/received_events","type":"User","site_admin":false},"repo":{"id":127177702,"name":"FARMA","full_name":"Bartiechen/FARMA","owner":{"login":"Bartiechen","id":27712455,"avatar_url":"https://avatars3.githubusercontent.com/u/27712455?v=4","gravatar_id":"","url":"https://api.github.com/users/Bartiechen","html_url":"https://github.com/Bartiechen","followers_url":"https://api.github.com/users/Bartiechen/followers","following_url":"https://api.github.com/users/Bartiechen/following{/other_user}","gists_url":"https://api.github.com/users/Bartiechen/gists{/gist_id}","starred_url":"https://api.github.com/users/Bartiechen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bartiechen/subscriptions","organizations_url":"https://api.github.com/users/Bartiechen/orgs","repos_url":"https://api.github.com/users/Bartiechen/repos","events_url":"https://api.github.com/users/Bartiechen/events{/privacy}","received_events_url":"https://api.github.com/users/Bartiechen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Bartiechen/FARMA","description":"FARMA: Ferramenta de Autoria para a Remediação de Erros com Mobilidade na Aprendizagem","fork":true,"url":"https://api.github.com/repos/Bartiechen/FARMA","forks_url":"https://api.github.com/repos/Bartiechen/FARMA/forks","keys_url":"https://api.github.com/repos/Bartiechen/FARMA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bartiechen/FARMA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bartiechen/FARMA/teams","hooks_url":"https://api.github.com/repos/Bartiechen/FARMA/hooks","issue_events_url":"https://api.github.com/repos/Bartiechen/FARMA/issues/events{/number}","events_url":"https://api.github.com/repos/Bartiechen/FARMA/events","assignees_url":"https://api.github.com/repos/Bartiechen/FARMA/assignees{/user}","branches_url":"https://api.github.com/repos/Bartiechen/FARMA/branches{/branch}","tags_url":"https://api.github.com/repos/Bartiechen/FARMA/tags","blobs_url":"https://api.github.com/repos/Bartiechen/FARMA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bartiechen/FARMA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bartiechen/FARMA/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bartiechen/FARMA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bartiechen/FARMA/statuses/{sha}","languages_url":"https://api.github.com/repos/Bartiechen/FARMA/languages","stargazers_url":"https://api.github.com/repos/Bartiechen/FARMA/stargazers","contributors_url":"https://api.github.com/repos/Bartiechen/FARMA/contributors","subscribers_url":"https://api.github.com/repos/Bartiechen/FARMA/subscribers","subscription_url":"https://api.github.com/repos/Bartiechen/FARMA/subscription","commits_url":"https://api.github.com/repos/Bartiechen/FARMA/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bartiechen/FARMA/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bartiechen/FARMA/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bartiechen/FARMA/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bartiechen/FARMA/contents/{+path}","compare_url":"https://api.github.com/repos/Bartiechen/FARMA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bartiechen/FARMA/merges","archive_url":"https://api.github.com/repos/Bartiechen/FARMA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bartiechen/FARMA/downloads","issues_url":"https://api.github.com/repos/Bartiechen/FARMA/issues{/number}","pulls_url":"https://api.github.com/repos/Bartiechen/FARMA/pulls{/number}","milestones_url":"https://api.github.com/repos/Bartiechen/FARMA/milestones{/number}","notifications_url":"https://api.github.com/repos/Bartiechen/FARMA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bartiechen/FARMA/labels{/name}","releases_url":"https://api.github.com/repos/Bartiechen/FARMA/releases{/id}","deployments_url":"https://api.github.com/repos/Bartiechen/FARMA/deployments","created_at":"2018-03-28T17:51:48Z","updated_at":"2018-04-13T18:23:28Z","pushed_at":"2018-04-17T17:51:45Z","git_url":"git://github.com/Bartiechen/FARMA.git","ssh_url":"git@github.com:Bartiechen/FARMA.git","clone_url":"https://github.com/Bartiechen/FARMA.git","svn_url":"https://github.com/Bartiechen/FARMA","homepage":null,"size":14929,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dmarczal:master","ref":"master","sha":"89bbfa89075467ae3ac496ee54bddb8437d589bd","user":{"login":"dmarczal","id":484005,"avatar_url":"https://avatars3.githubusercontent.com/u/484005?v=4","gravatar_id":"","url":"https://api.github.com/users/dmarczal","html_url":"https://github.com/dmarczal","followers_url":"https://api.github.com/users/dmarczal/followers","following_url":"https://api.github.com/users/dmarczal/following{/other_user}","gists_url":"https://api.github.com/users/dmarczal/gists{/gist_id}","starred_url":"https://api.github.com/users/dmarczal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmarczal/subscriptions","organizations_url":"https://api.github.com/users/dmarczal/orgs","repos_url":"https://api.github.com/users/dmarczal/repos","events_url":"https://api.github.com/users/dmarczal/events{/privacy}","received_events_url":"https://api.github.com/users/dmarczal/received_events","type":"User","site_admin":false},"repo":{"id":112750198,"name":"FARMA","full_name":"dmarczal/FARMA","owner":{"login":"dmarczal","id":484005,"avatar_url":"https://avatars3.githubusercontent.com/u/484005?v=4","gravatar_id":"","url":"https://api.github.com/users/dmarczal","html_url":"https://github.com/dmarczal","followers_url":"https://api.github.com/users/dmarczal/followers","following_url":"https://api.github.com/users/dmarczal/following{/other_user}","gists_url":"https://api.github.com/users/dmarczal/gists{/gist_id}","starred_url":"https://api.github.com/users/dmarczal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmarczal/subscriptions","organizations_url":"https://api.github.com/users/dmarczal/orgs","repos_url":"https://api.github.com/users/dmarczal/repos","events_url":"https://api.github.com/users/dmarczal/events{/privacy}","received_events_url":"https://api.github.com/users/dmarczal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmarczal/FARMA","description":"FARMA: Authoring Tool for Remediation of Errors with Mobile in Learning.","fork":false,"url":"https://api.github.com/repos/dmarczal/FARMA","forks_url":"https://api.github.com/repos/dmarczal/FARMA/forks","keys_url":"https://api.github.com/repos/dmarczal/FARMA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmarczal/FARMA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmarczal/FARMA/teams","hooks_url":"https://api.github.com/repos/dmarczal/FARMA/hooks","issue_events_url":"https://api.github.com/repos/dmarczal/FARMA/issues/events{/number}","events_url":"https://api.github.com/repos/dmarczal/FARMA/events","assignees_url":"https://api.github.com/repos/dmarczal/FARMA/assignees{/user}","branches_url":"https://api.github.com/repos/dmarczal/FARMA/branches{/branch}","tags_url":"https://api.github.com/repos/dmarczal/FARMA/tags","blobs_url":"https://api.github.com/repos/dmarczal/FARMA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmarczal/FARMA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmarczal/FARMA/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmarczal/FARMA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmarczal/FARMA/statuses/{sha}","languages_url":"https://api.github.com/repos/dmarczal/FARMA/languages","stargazers_url":"https://api.github.com/repos/dmarczal/FARMA/stargazers","contributors_url":"https://api.github.com/repos/dmarczal/FARMA/contributors","subscribers_url":"https://api.github.com/repos/dmarczal/FARMA/subscribers","subscription_url":"https://api.github.com/repos/dmarczal/FARMA/subscription","commits_url":"https://api.github.com/repos/dmarczal/FARMA/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmarczal/FARMA/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmarczal/FARMA/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmarczal/FARMA/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmarczal/FARMA/contents/{+path}","compare_url":"https://api.github.com/repos/dmarczal/FARMA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmarczal/FARMA/merges","archive_url":"https://api.github.com/repos/dmarczal/FARMA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmarczal/FARMA/downloads","issues_url":"https://api.github.com/repos/dmarczal/FARMA/issues{/number}","pulls_url":"https://api.github.com/repos/dmarczal/FARMA/pulls{/number}","milestones_url":"https://api.github.com/repos/dmarczal/FARMA/milestones{/number}","notifications_url":"https://api.github.com/repos/dmarczal/FARMA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmarczal/FARMA/labels{/name}","releases_url":"https://api.github.com/repos/dmarczal/FARMA/releases{/id}","deployments_url":"https://api.github.com/repos/dmarczal/FARMA/deployments","created_at":"2017-12-01T14:39:38Z","updated_at":"2018-04-12T00:18:12Z","pushed_at":"2018-04-18T19:53:25Z","git_url":"git://github.com/dmarczal/FARMA.git","ssh_url":"git@github.com:dmarczal/FARMA.git","clone_url":"https://github.com/dmarczal/FARMA.git","svn_url":"https://github.com/dmarczal/FARMA","homepage":"http://farma-reborn.educacional.mat.br","size":14923,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":3,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dmarczal/FARMA/pulls/12"},"html":{"href":"https://github.com/dmarczal/FARMA/pull/12"},"issue":{"href":"https://api.github.com/repos/dmarczal/FARMA/issues/12"},"comments":{"href":"https://api.github.com/repos/dmarczal/FARMA/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/dmarczal/FARMA/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/dmarczal/FARMA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dmarczal/FARMA/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/dmarczal/FARMA/statuses/f807d79573c24ededa755a47d52c311065814b7f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dmarczal"}}