{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fts_35/pulls/comments/34117739","id":34117739,"diff_hunk":"@@ -0,0 +1,30 @@\n+class Admin::QuestionsController < ApplicationController\n+  before_action :set_category, only: [:new, :create]\n+\n+  def new\n+    @question = @category.questions.build\n+    Settings.question.minimum_answers.times{@question.answers.build}\n+  end\n+\n+  def create\n+    @question = @category.questions.new question_params\n+    if @question.save\n+      redirect_to admin_category_url @category, success: t(\".question_created\")\n+    else\n+      if @question.answers.length < Settings.question.minimum_answers","path":"app/controllers/admin/questions_controller.rb","position":14,"original_position":14,"commit_id":"f423adc700a2fa8dba2a3ee51f4662675b5a0faa","original_commit_id":"f423adc700a2fa8dba2a3ee51f4662675b5a0faa","user":{"login":"dieunb","id":2122175,"avatar_url":"https://avatars.githubusercontent.com/u/2122175?v=3","gravatar_id":"","url":"https://api.github.com/users/dieunb","html_url":"https://github.com/dieunb","followers_url":"https://api.github.com/users/dieunb/followers","following_url":"https://api.github.com/users/dieunb/following{/other_user}","gists_url":"https://api.github.com/users/dieunb/gists{/gist_id}","starred_url":"https://api.github.com/users/dieunb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dieunb/subscriptions","organizations_url":"https://api.github.com/users/dieunb/orgs","repos_url":"https://api.github.com/users/dieunb/repos","events_url":"https://api.github.com/users/dieunb/events{/privacy}","received_events_url":"https://api.github.com/users/dieunb/received_events","type":"User","site_admin":false},"body":"\r\nis it necessary?","created_at":"2015-07-08T05:56:43Z","updated_at":"2015-07-08T05:56:43Z","html_url":"https://github.com/framgia/fts_35/pull/15#discussion_r34117739","pull_request_url":"https://api.github.com/repos/framgia/fts_35/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/framgia/fts_35/pulls/comments/34117739"},"html":{"href":"https://github.com/framgia/fts_35/pull/15#discussion_r34117739"},"pull_request":{"href":"https://api.github.com/repos/framgia/fts_35/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fts_35/pulls/15","id":39440828,"html_url":"https://github.com/framgia/fts_35/pull/15","diff_url":"https://github.com/framgia/fts_35/pull/15.diff","patch_url":"https://github.com/framgia/fts_35/pull/15.patch","issue_url":"https://api.github.com/repos/framgia/fts_35/issues/15","number":15,"state":"open","locked":false,"title":"Task #34168 Admin can add question to category","user":{"login":"phuongbk","id":8966876,"avatar_url":"https://avatars.githubusercontent.com/u/8966876?v=3","gravatar_id":"","url":"https://api.github.com/users/phuongbk","html_url":"https://github.com/phuongbk","followers_url":"https://api.github.com/users/phuongbk/followers","following_url":"https://api.github.com/users/phuongbk/following{/other_user}","gists_url":"https://api.github.com/users/phuongbk/gists{/gist_id}","starred_url":"https://api.github.com/users/phuongbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phuongbk/subscriptions","organizations_url":"https://api.github.com/users/phuongbk/orgs","repos_url":"https://api.github.com/users/phuongbk/repos","events_url":"https://api.github.com/users/phuongbk/events{/privacy}","received_events_url":"https://api.github.com/users/phuongbk/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-08T04:33:42Z","updated_at":"2015-07-08T05:56:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d4ed18d9e178dbeea07c4efadbd8c0d19eef4cad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fts_35/pulls/15/commits","review_comments_url":"https://api.github.com/repos/framgia/fts_35/pulls/15/comments","review_comment_url":"https://api.github.com/repos/framgia/fts_35/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fts_35/issues/15/comments","statuses_url":"https://api.github.com/repos/framgia/fts_35/statuses/f423adc700a2fa8dba2a3ee51f4662675b5a0faa","head":{"label":"phuongbk:Task/34168","ref":"Task/34168","sha":"f423adc700a2fa8dba2a3ee51f4662675b5a0faa","user":{"login":"phuongbk","id":8966876,"avatar_url":"https://avatars.githubusercontent.com/u/8966876?v=3","gravatar_id":"","url":"https://api.github.com/users/phuongbk","html_url":"https://github.com/phuongbk","followers_url":"https://api.github.com/users/phuongbk/followers","following_url":"https://api.github.com/users/phuongbk/following{/other_user}","gists_url":"https://api.github.com/users/phuongbk/gists{/gist_id}","starred_url":"https://api.github.com/users/phuongbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phuongbk/subscriptions","organizations_url":"https://api.github.com/users/phuongbk/orgs","repos_url":"https://api.github.com/users/phuongbk/repos","events_url":"https://api.github.com/users/phuongbk/events{/privacy}","received_events_url":"https://api.github.com/users/phuongbk/received_events","type":"User","site_admin":false},"repo":{"id":38596701,"name":"fts_35","full_name":"phuongbk/fts_35","owner":{"login":"phuongbk","id":8966876,"avatar_url":"https://avatars.githubusercontent.com/u/8966876?v=3","gravatar_id":"","url":"https://api.github.com/users/phuongbk","html_url":"https://github.com/phuongbk","followers_url":"https://api.github.com/users/phuongbk/followers","following_url":"https://api.github.com/users/phuongbk/following{/other_user}","gists_url":"https://api.github.com/users/phuongbk/gists{/gist_id}","starred_url":"https://api.github.com/users/phuongbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phuongbk/subscriptions","organizations_url":"https://api.github.com/users/phuongbk/orgs","repos_url":"https://api.github.com/users/phuongbk/repos","events_url":"https://api.github.com/users/phuongbk/events{/privacy}","received_events_url":"https://api.github.com/users/phuongbk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phuongbk/fts_35","description":"Framgia Test System (training)","fork":true,"url":"https://api.github.com/repos/phuongbk/fts_35","forks_url":"https://api.github.com/repos/phuongbk/fts_35/forks","keys_url":"https://api.github.com/repos/phuongbk/fts_35/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phuongbk/fts_35/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phuongbk/fts_35/teams","hooks_url":"https://api.github.com/repos/phuongbk/fts_35/hooks","issue_events_url":"https://api.github.com/repos/phuongbk/fts_35/issues/events{/number}","events_url":"https://api.github.com/repos/phuongbk/fts_35/events","assignees_url":"https://api.github.com/repos/phuongbk/fts_35/assignees{/user}","branches_url":"https://api.github.com/repos/phuongbk/fts_35/branches{/branch}","tags_url":"https://api.github.com/repos/phuongbk/fts_35/tags","blobs_url":"https://api.github.com/repos/phuongbk/fts_35/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phuongbk/fts_35/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phuongbk/fts_35/git/refs{/sha}","trees_url":"https://api.github.com/repos/phuongbk/fts_35/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phuongbk/fts_35/statuses/{sha}","languages_url":"https://api.github.com/repos/phuongbk/fts_35/languages","stargazers_url":"https://api.github.com/repos/phuongbk/fts_35/stargazers","contributors_url":"https://api.github.com/repos/phuongbk/fts_35/contributors","subscribers_url":"https://api.github.com/repos/phuongbk/fts_35/subscribers","subscription_url":"https://api.github.com/repos/phuongbk/fts_35/subscription","commits_url":"https://api.github.com/repos/phuongbk/fts_35/commits{/sha}","git_commits_url":"https://api.github.com/repos/phuongbk/fts_35/git/commits{/sha}","comments_url":"https://api.github.com/repos/phuongbk/fts_35/comments{/number}","issue_comment_url":"https://api.github.com/repos/phuongbk/fts_35/issues/comments{/number}","contents_url":"https://api.github.com/repos/phuongbk/fts_35/contents/{+path}","compare_url":"https://api.github.com/repos/phuongbk/fts_35/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phuongbk/fts_35/merges","archive_url":"https://api.github.com/repos/phuongbk/fts_35/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phuongbk/fts_35/downloads","issues_url":"https://api.github.com/repos/phuongbk/fts_35/issues{/number}","pulls_url":"https://api.github.com/repos/phuongbk/fts_35/pulls{/number}","milestones_url":"https://api.github.com/repos/phuongbk/fts_35/milestones{/number}","notifications_url":"https://api.github.com/repos/phuongbk/fts_35/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phuongbk/fts_35/labels{/name}","releases_url":"https://api.github.com/repos/phuongbk/fts_35/releases{/id}","created_at":"2015-07-06T03:59:47Z","updated_at":"2015-07-06T02:09:12Z","pushed_at":"2015-07-08T04:33:14Z","git_url":"git://github.com/phuongbk/fts_35.git","ssh_url":"git@github.com:phuongbk/fts_35.git","clone_url":"https://github.com/phuongbk/fts_35.git","svn_url":"https://github.com/phuongbk/fts_35","homepage":null,"size":208,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"framgia:develop","ref":"develop","sha":"87d1f1193f592e97d1aa3cae681cad2dad92413a","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":38592587,"name":"fts_35","full_name":"framgia/fts_35","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/fts_35","description":"Framgia Test System (training)","fork":false,"url":"https://api.github.com/repos/framgia/fts_35","forks_url":"https://api.github.com/repos/framgia/fts_35/forks","keys_url":"https://api.github.com/repos/framgia/fts_35/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fts_35/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fts_35/teams","hooks_url":"https://api.github.com/repos/framgia/fts_35/hooks","issue_events_url":"https://api.github.com/repos/framgia/fts_35/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fts_35/events","assignees_url":"https://api.github.com/repos/framgia/fts_35/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fts_35/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fts_35/tags","blobs_url":"https://api.github.com/repos/framgia/fts_35/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fts_35/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fts_35/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fts_35/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fts_35/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fts_35/languages","stargazers_url":"https://api.github.com/repos/framgia/fts_35/stargazers","contributors_url":"https://api.github.com/repos/framgia/fts_35/contributors","subscribers_url":"https://api.github.com/repos/framgia/fts_35/subscribers","subscription_url":"https://api.github.com/repos/framgia/fts_35/subscription","commits_url":"https://api.github.com/repos/framgia/fts_35/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fts_35/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fts_35/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fts_35/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fts_35/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fts_35/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fts_35/merges","archive_url":"https://api.github.com/repos/framgia/fts_35/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fts_35/downloads","issues_url":"https://api.github.com/repos/framgia/fts_35/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fts_35/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fts_35/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fts_35/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fts_35/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fts_35/releases{/id}","created_at":"2015-07-06T02:09:12Z","updated_at":"2015-07-06T02:09:12Z","pushed_at":"2015-07-08T04:44:17Z","git_url":"git://github.com/framgia/fts_35.git","ssh_url":"git@github.com:framgia/fts_35.git","clone_url":"https://github.com/framgia/fts_35.git","svn_url":"https://github.com/framgia/fts_35","homepage":null,"size":353,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fts_35/pulls/15"},"html":{"href":"https://github.com/framgia/fts_35/pull/15"},"issue":{"href":"https://api.github.com/repos/framgia/fts_35/issues/15"},"comments":{"href":"https://api.github.com/repos/framgia/fts_35/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fts_35/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fts_35/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fts_35/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fts_35/statuses/f423adc700a2fa8dba2a3ee51f4662675b5a0faa"}}}}