{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/brs_41/pulls/comments/90014516","pull_request_review_id":10539526,"id":90014516,"diff_hunk":"@@ -0,0 +1,66 @@\n+class RequestsController < ApplicationController\n+  def index\n+    @requests = Request.where(user_id:current_user.id).order(\"status asc\").paginate(page: params[:page],per_page: Settings.ten)\n+  end\n+\n+  def create\n+    status=params[:request][:status]\n+    if status.nil?\n+      request = Request.new(request_params)\n+      if request.save\n+        flash[:success] = t(\"success_create\")\n+        redirect_to root_url\n+      else\n+        flash[:info] = t(\"error_create\")\n+        render :new\n+      end\n+    else\n+      category_id=params[:request][:cate_name]\n+      if category_id==\"\"\n+        request = request_load\n+        category = compare_catetegory request.cate_name\n+        approve_request request, category\n+      else\n+        category = Category.find_by_id(category_id)\n+        request = Request.find_by_id(params[:request][:id])\n+        approve_request request, category\n+      end\n+    end\n+  end\n+\n+  def destroy\n+    request_load.destroy","path":"app/controllers/requests_controller.rb","position":32,"original_position":32,"commit_id":"e47f54347ebaf0f73c229c80e204490dd5a35e1d","original_commit_id":"e47f54347ebaf0f73c229c80e204490dd5a35e1d","user":{"login":"nvtanh","id":5591946,"avatar_url":"https://avatars.githubusercontent.com/u/5591946?v=3","gravatar_id":"","url":"https://api.github.com/users/nvtanh","html_url":"https://github.com/nvtanh","followers_url":"https://api.github.com/users/nvtanh/followers","following_url":"https://api.github.com/users/nvtanh/following{/other_user}","gists_url":"https://api.github.com/users/nvtanh/gists{/gist_id}","starred_url":"https://api.github.com/users/nvtanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvtanh/subscriptions","organizations_url":"https://api.github.com/users/nvtanh/orgs","repos_url":"https://api.github.com/users/nvtanh/repos","events_url":"https://api.github.com/users/nvtanh/events{/privacy}","received_events_url":"https://api.github.com/users/nvtanh/received_events","type":"User","site_admin":false},"body":"nếu destroy fail thì sao ?","created_at":"2016-11-29T14:06:52Z","updated_at":"2016-11-29T14:12:13Z","html_url":"https://github.com/framgia/brs_41/pull/10#discussion_r90014516","pull_request_url":"https://api.github.com/repos/framgia/brs_41/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/framgia/brs_41/pulls/comments/90014516"},"html":{"href":"https://github.com/framgia/brs_41/pull/10#discussion_r90014516"},"pull_request":{"href":"https://api.github.com/repos/framgia/brs_41/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/brs_41/pulls/10","id":95670933,"html_url":"https://github.com/framgia/brs_41/pull/10","diff_url":"https://github.com/framgia/brs_41/pull/10.diff","patch_url":"https://github.com/framgia/brs_41/pull/10.patch","issue_url":"https://api.github.com/repos/framgia/brs_41/issues/10","number":10,"state":"open","locked":false,"title":"Done Request","user":{"login":"kewdev","id":23021580,"avatar_url":"https://avatars.githubusercontent.com/u/23021580?v=3","gravatar_id":"","url":"https://api.github.com/users/kewdev","html_url":"https://github.com/kewdev","followers_url":"https://api.github.com/users/kewdev/followers","following_url":"https://api.github.com/users/kewdev/following{/other_user}","gists_url":"https://api.github.com/users/kewdev/gists{/gist_id}","starred_url":"https://api.github.com/users/kewdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kewdev/subscriptions","organizations_url":"https://api.github.com/users/kewdev/orgs","repos_url":"https://api.github.com/users/kewdev/repos","events_url":"https://api.github.com/users/kewdev/events{/privacy}","received_events_url":"https://api.github.com/users/kewdev/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-29T11:08:35Z","updated_at":"2016-11-29T14:12:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a9e85131ad6ed240001bf71a54501b180bbbaee","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/brs_41/pulls/10/commits","review_comments_url":"https://api.github.com/repos/framgia/brs_41/pulls/10/comments","review_comment_url":"https://api.github.com/repos/framgia/brs_41/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/brs_41/issues/10/comments","statuses_url":"https://api.github.com/repos/framgia/brs_41/statuses/e47f54347ebaf0f73c229c80e204490dd5a35e1d","head":{"label":"kewdev:request","ref":"request","sha":"e47f54347ebaf0f73c229c80e204490dd5a35e1d","user":{"login":"kewdev","id":23021580,"avatar_url":"https://avatars.githubusercontent.com/u/23021580?v=3","gravatar_id":"","url":"https://api.github.com/users/kewdev","html_url":"https://github.com/kewdev","followers_url":"https://api.github.com/users/kewdev/followers","following_url":"https://api.github.com/users/kewdev/following{/other_user}","gists_url":"https://api.github.com/users/kewdev/gists{/gist_id}","starred_url":"https://api.github.com/users/kewdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kewdev/subscriptions","organizations_url":"https://api.github.com/users/kewdev/orgs","repos_url":"https://api.github.com/users/kewdev/repos","events_url":"https://api.github.com/users/kewdev/events{/privacy}","received_events_url":"https://api.github.com/users/kewdev/received_events","type":"User","site_admin":false},"repo":{"id":75054675,"name":"brs_41","full_name":"kewdev/brs_41","owner":{"login":"kewdev","id":23021580,"avatar_url":"https://avatars.githubusercontent.com/u/23021580?v=3","gravatar_id":"","url":"https://api.github.com/users/kewdev","html_url":"https://github.com/kewdev","followers_url":"https://api.github.com/users/kewdev/followers","following_url":"https://api.github.com/users/kewdev/following{/other_user}","gists_url":"https://api.github.com/users/kewdev/gists{/gist_id}","starred_url":"https://api.github.com/users/kewdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kewdev/subscriptions","organizations_url":"https://api.github.com/users/kewdev/orgs","repos_url":"https://api.github.com/users/kewdev/repos","events_url":"https://api.github.com/users/kewdev/events{/privacy}","received_events_url":"https://api.github.com/users/kewdev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kewdev/brs_41","description":null,"fork":true,"url":"https://api.github.com/repos/kewdev/brs_41","forks_url":"https://api.github.com/repos/kewdev/brs_41/forks","keys_url":"https://api.github.com/repos/kewdev/brs_41/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kewdev/brs_41/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kewdev/brs_41/teams","hooks_url":"https://api.github.com/repos/kewdev/brs_41/hooks","issue_events_url":"https://api.github.com/repos/kewdev/brs_41/issues/events{/number}","events_url":"https://api.github.com/repos/kewdev/brs_41/events","assignees_url":"https://api.github.com/repos/kewdev/brs_41/assignees{/user}","branches_url":"https://api.github.com/repos/kewdev/brs_41/branches{/branch}","tags_url":"https://api.github.com/repos/kewdev/brs_41/tags","blobs_url":"https://api.github.com/repos/kewdev/brs_41/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kewdev/brs_41/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kewdev/brs_41/git/refs{/sha}","trees_url":"https://api.github.com/repos/kewdev/brs_41/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kewdev/brs_41/statuses/{sha}","languages_url":"https://api.github.com/repos/kewdev/brs_41/languages","stargazers_url":"https://api.github.com/repos/kewdev/brs_41/stargazers","contributors_url":"https://api.github.com/repos/kewdev/brs_41/contributors","subscribers_url":"https://api.github.com/repos/kewdev/brs_41/subscribers","subscription_url":"https://api.github.com/repos/kewdev/brs_41/subscription","commits_url":"https://api.github.com/repos/kewdev/brs_41/commits{/sha}","git_commits_url":"https://api.github.com/repos/kewdev/brs_41/git/commits{/sha}","comments_url":"https://api.github.com/repos/kewdev/brs_41/comments{/number}","issue_comment_url":"https://api.github.com/repos/kewdev/brs_41/issues/comments{/number}","contents_url":"https://api.github.com/repos/kewdev/brs_41/contents/{+path}","compare_url":"https://api.github.com/repos/kewdev/brs_41/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kewdev/brs_41/merges","archive_url":"https://api.github.com/repos/kewdev/brs_41/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kewdev/brs_41/downloads","issues_url":"https://api.github.com/repos/kewdev/brs_41/issues{/number}","pulls_url":"https://api.github.com/repos/kewdev/brs_41/pulls{/number}","milestones_url":"https://api.github.com/repos/kewdev/brs_41/milestones{/number}","notifications_url":"https://api.github.com/repos/kewdev/brs_41/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kewdev/brs_41/labels{/name}","releases_url":"https://api.github.com/repos/kewdev/brs_41/releases{/id}","deployments_url":"https://api.github.com/repos/kewdev/brs_41/deployments","created_at":"2016-11-29T07:24:43Z","updated_at":"2016-11-16T04:29:55Z","pushed_at":"2016-11-29T11:10:01Z","git_url":"git://github.com/kewdev/brs_41.git","ssh_url":"git@github.com:kewdev/brs_41.git","clone_url":"https://github.com/kewdev/brs_41.git","svn_url":"https://github.com/kewdev/brs_41","homepage":null,"size":5756,"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":"93e1edce96a7f74b2c238449055fc18e737df60e","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":73884082,"name":"brs_41","full_name":"framgia/brs_41","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/brs_41","description":null,"fork":false,"url":"https://api.github.com/repos/framgia/brs_41","forks_url":"https://api.github.com/repos/framgia/brs_41/forks","keys_url":"https://api.github.com/repos/framgia/brs_41/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/brs_41/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/brs_41/teams","hooks_url":"https://api.github.com/repos/framgia/brs_41/hooks","issue_events_url":"https://api.github.com/repos/framgia/brs_41/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/brs_41/events","assignees_url":"https://api.github.com/repos/framgia/brs_41/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/brs_41/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/brs_41/tags","blobs_url":"https://api.github.com/repos/framgia/brs_41/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/brs_41/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/brs_41/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/brs_41/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/brs_41/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/brs_41/languages","stargazers_url":"https://api.github.com/repos/framgia/brs_41/stargazers","contributors_url":"https://api.github.com/repos/framgia/brs_41/contributors","subscribers_url":"https://api.github.com/repos/framgia/brs_41/subscribers","subscription_url":"https://api.github.com/repos/framgia/brs_41/subscription","commits_url":"https://api.github.com/repos/framgia/brs_41/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/brs_41/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/brs_41/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/brs_41/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/brs_41/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/brs_41/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/brs_41/merges","archive_url":"https://api.github.com/repos/framgia/brs_41/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/brs_41/downloads","issues_url":"https://api.github.com/repos/framgia/brs_41/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/brs_41/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/brs_41/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/brs_41/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/brs_41/labels{/name}","releases_url":"https://api.github.com/repos/framgia/brs_41/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/brs_41/deployments","created_at":"2016-11-16T04:29:55Z","updated_at":"2016-11-16T04:29:55Z","pushed_at":"2016-11-29T11:10:02Z","git_url":"git://github.com/framgia/brs_41.git","ssh_url":"git@github.com:framgia/brs_41.git","clone_url":"https://github.com/framgia/brs_41.git","svn_url":"https://github.com/framgia/brs_41","homepage":null,"size":1403,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/brs_41/pulls/10"},"html":{"href":"https://github.com/framgia/brs_41/pull/10"},"issue":{"href":"https://api.github.com/repos/framgia/brs_41/issues/10"},"comments":{"href":"https://api.github.com/repos/framgia/brs_41/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/brs_41/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/brs_41/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/brs_41/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/brs_41/statuses/e47f54347ebaf0f73c229c80e204490dd5a35e1d"}}}}
{"actor":{"display_login":"nvtanh"}}