{"action":"created","comment":{"url":"https://api.github.com/repos/awesome-academy/bookstore/pulls/comments/230659502","pull_request_review_id":171444307,"id":230659502,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDY1OTUwMg==","diff_hunk":"@@ -0,0 +1,23 @@\n+class Admin::UsersController < Admin::BaseController\n+  before_action {flash.clear}\n+\n+  def index\n+    @users = User.select_users.created_at.paginate page: params[:page] , per_page: Settings.admin.user.per_page\n+  end\n+\n+  def destroy\n+    user = User.find_by id: params[:id]\n+    if user.is_admin?\n+      flash[:danger] = t \".cant\"\n+    else\n+      flash[:success] = t \".success\"\n+      User.delete(user)","path":"app/controllers/admin/users_controller.rb","position":14,"original_position":14,"commit_id":"58799444dc9ee252b695a212597b33916bb6a380","original_commit_id":"58799444dc9ee252b695a212597b33916bb6a380","user":{"login":"huongnguyenmta","id":18224922,"node_id":"MDQ6VXNlcjE4MjI0OTIy","avatar_url":"https://avatars3.githubusercontent.com/u/18224922?v=4","gravatar_id":"","url":"https://api.github.com/users/huongnguyenmta","html_url":"https://github.com/huongnguyenmta","followers_url":"https://api.github.com/users/huongnguyenmta/followers","following_url":"https://api.github.com/users/huongnguyenmta/following{/other_user}","gists_url":"https://api.github.com/users/huongnguyenmta/gists{/gist_id}","starred_url":"https://api.github.com/users/huongnguyenmta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huongnguyenmta/subscriptions","organizations_url":"https://api.github.com/users/huongnguyenmta/orgs","repos_url":"https://api.github.com/users/huongnguyenmta/repos","events_url":"https://api.github.com/users/huongnguyenmta/events{/privacy}","received_events_url":"https://api.github.com/users/huongnguyenmta/received_events","type":"User","site_admin":false},"body":"check trường hợp destroy fail nè","created_at":"2018-11-05T08:10:04Z","updated_at":"2018-11-05T08:11:18Z","html_url":"https://github.com/awesome-academy/bookstore/pull/21#discussion_r230659502","pull_request_url":"https://api.github.com/repos/awesome-academy/bookstore/pulls/21","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/awesome-academy/bookstore/pulls/comments/230659502"},"html":{"href":"https://github.com/awesome-academy/bookstore/pull/21#discussion_r230659502"},"pull_request":{"href":"https://api.github.com/repos/awesome-academy/bookstore/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/awesome-academy/bookstore/pulls/21","id":227545420,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3NTQ1NDIw","html_url":"https://github.com/awesome-academy/bookstore/pull/21","diff_url":"https://github.com/awesome-academy/bookstore/pull/21.diff","patch_url":"https://github.com/awesome-academy/bookstore/pull/21.patch","issue_url":"https://api.github.com/repos/awesome-academy/bookstore/issues/21","number":21,"state":"open","locked":false,"title":" Refs task #2804: Admin show and delete users.","user":{"login":"hoangtronghieu1812","id":43598873,"node_id":"MDQ6VXNlcjQzNTk4ODcz","avatar_url":"https://avatars3.githubusercontent.com/u/43598873?v=4","gravatar_id":"","url":"https://api.github.com/users/hoangtronghieu1812","html_url":"https://github.com/hoangtronghieu1812","followers_url":"https://api.github.com/users/hoangtronghieu1812/followers","following_url":"https://api.github.com/users/hoangtronghieu1812/following{/other_user}","gists_url":"https://api.github.com/users/hoangtronghieu1812/gists{/gist_id}","starred_url":"https://api.github.com/users/hoangtronghieu1812/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoangtronghieu1812/subscriptions","organizations_url":"https://api.github.com/users/hoangtronghieu1812/orgs","repos_url":"https://api.github.com/users/hoangtronghieu1812/repos","events_url":"https://api.github.com/users/hoangtronghieu1812/events{/privacy}","received_events_url":"https://api.github.com/users/hoangtronghieu1812/received_events","type":"User","site_admin":false},"body":"1, admin can't delete admin and himself\r\n2, admin can delete users. (admin/users#destroy)","created_at":"2018-11-01T08:23:10Z","updated_at":"2018-11-05T08:11:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"caec7078dd4e8945de34a06b76d589fd8c93a1ed","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/awesome-academy/bookstore/pulls/21/commits","review_comments_url":"https://api.github.com/repos/awesome-academy/bookstore/pulls/21/comments","review_comment_url":"https://api.github.com/repos/awesome-academy/bookstore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awesome-academy/bookstore/issues/21/comments","statuses_url":"https://api.github.com/repos/awesome-academy/bookstore/statuses/58799444dc9ee252b695a212597b33916bb6a380","head":{"label":"hoangtronghieu1812:admin-show-all-users","ref":"admin-show-all-users","sha":"58799444dc9ee252b695a212597b33916bb6a380","user":{"login":"hoangtronghieu1812","id":43598873,"node_id":"MDQ6VXNlcjQzNTk4ODcz","avatar_url":"https://avatars3.githubusercontent.com/u/43598873?v=4","gravatar_id":"","url":"https://api.github.com/users/hoangtronghieu1812","html_url":"https://github.com/hoangtronghieu1812","followers_url":"https://api.github.com/users/hoangtronghieu1812/followers","following_url":"https://api.github.com/users/hoangtronghieu1812/following{/other_user}","gists_url":"https://api.github.com/users/hoangtronghieu1812/gists{/gist_id}","starred_url":"https://api.github.com/users/hoangtronghieu1812/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoangtronghieu1812/subscriptions","organizations_url":"https://api.github.com/users/hoangtronghieu1812/orgs","repos_url":"https://api.github.com/users/hoangtronghieu1812/repos","events_url":"https://api.github.com/users/hoangtronghieu1812/events{/privacy}","received_events_url":"https://api.github.com/users/hoangtronghieu1812/received_events","type":"User","site_admin":false},"repo":{"id":153570669,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM1NzA2Njk=","name":"bookstore","full_name":"hoangtronghieu1812/bookstore","private":false,"owner":{"login":"hoangtronghieu1812","id":43598873,"node_id":"MDQ6VXNlcjQzNTk4ODcz","avatar_url":"https://avatars3.githubusercontent.com/u/43598873?v=4","gravatar_id":"","url":"https://api.github.com/users/hoangtronghieu1812","html_url":"https://github.com/hoangtronghieu1812","followers_url":"https://api.github.com/users/hoangtronghieu1812/followers","following_url":"https://api.github.com/users/hoangtronghieu1812/following{/other_user}","gists_url":"https://api.github.com/users/hoangtronghieu1812/gists{/gist_id}","starred_url":"https://api.github.com/users/hoangtronghieu1812/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoangtronghieu1812/subscriptions","organizations_url":"https://api.github.com/users/hoangtronghieu1812/orgs","repos_url":"https://api.github.com/users/hoangtronghieu1812/repos","events_url":"https://api.github.com/users/hoangtronghieu1812/events{/privacy}","received_events_url":"https://api.github.com/users/hoangtronghieu1812/received_events","type":"User","site_admin":false},"html_url":"https://github.com/hoangtronghieu1812/bookstore","description":null,"fork":true,"url":"https://api.github.com/repos/hoangtronghieu1812/bookstore","forks_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/forks","keys_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/teams","hooks_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/hooks","issue_events_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/issues/events{/number}","events_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/events","assignees_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/assignees{/user}","branches_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/branches{/branch}","tags_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/tags","blobs_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/statuses/{sha}","languages_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/languages","stargazers_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/stargazers","contributors_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/contributors","subscribers_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/subscribers","subscription_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/subscription","commits_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/contents/{+path}","compare_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/merges","archive_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/downloads","issues_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/issues{/number}","pulls_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/pulls{/number}","milestones_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/milestones{/number}","notifications_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/labels{/name}","releases_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/releases{/id}","deployments_url":"https://api.github.com/repos/hoangtronghieu1812/bookstore/deployments","created_at":"2018-10-18T05:56:39Z","updated_at":"2018-10-18T05:56:41Z","pushed_at":"2018-11-05T06:30:20Z","git_url":"git://github.com/hoangtronghieu1812/bookstore.git","ssh_url":"git@github.com:hoangtronghieu1812/bookstore.git","clone_url":"https://github.com/hoangtronghieu1812/bookstore.git","svn_url":"https://github.com/hoangtronghieu1812/bookstore","homepage":null,"size":8950,"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":"awesome-academy:master","ref":"master","sha":"aa9fa67c32b6914ec06db9e300cee0c82c021915","user":{"login":"awesome-academy","id":33895223,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODk1MjIz","avatar_url":"https://avatars0.githubusercontent.com/u/33895223?v=4","gravatar_id":"","url":"https://api.github.com/users/awesome-academy","html_url":"https://github.com/awesome-academy","followers_url":"https://api.github.com/users/awesome-academy/followers","following_url":"https://api.github.com/users/awesome-academy/following{/other_user}","gists_url":"https://api.github.com/users/awesome-academy/gists{/gist_id}","starred_url":"https://api.github.com/users/awesome-academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awesome-academy/subscriptions","organizations_url":"https://api.github.com/users/awesome-academy/orgs","repos_url":"https://api.github.com/users/awesome-academy/repos","events_url":"https://api.github.com/users/awesome-academy/events{/privacy}","received_events_url":"https://api.github.com/users/awesome-academy/received_events","type":"Organization","site_admin":false},"repo":{"id":153256156,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMyNTYxNTY=","name":"bookstore","full_name":"awesome-academy/bookstore","private":false,"owner":{"login":"awesome-academy","id":33895223,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODk1MjIz","avatar_url":"https://avatars0.githubusercontent.com/u/33895223?v=4","gravatar_id":"","url":"https://api.github.com/users/awesome-academy","html_url":"https://github.com/awesome-academy","followers_url":"https://api.github.com/users/awesome-academy/followers","following_url":"https://api.github.com/users/awesome-academy/following{/other_user}","gists_url":"https://api.github.com/users/awesome-academy/gists{/gist_id}","starred_url":"https://api.github.com/users/awesome-academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awesome-academy/subscriptions","organizations_url":"https://api.github.com/users/awesome-academy/orgs","repos_url":"https://api.github.com/users/awesome-academy/repos","events_url":"https://api.github.com/users/awesome-academy/events{/privacy}","received_events_url":"https://api.github.com/users/awesome-academy/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/awesome-academy/bookstore","description":null,"fork":false,"url":"https://api.github.com/repos/awesome-academy/bookstore","forks_url":"https://api.github.com/repos/awesome-academy/bookstore/forks","keys_url":"https://api.github.com/repos/awesome-academy/bookstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awesome-academy/bookstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awesome-academy/bookstore/teams","hooks_url":"https://api.github.com/repos/awesome-academy/bookstore/hooks","issue_events_url":"https://api.github.com/repos/awesome-academy/bookstore/issues/events{/number}","events_url":"https://api.github.com/repos/awesome-academy/bookstore/events","assignees_url":"https://api.github.com/repos/awesome-academy/bookstore/assignees{/user}","branches_url":"https://api.github.com/repos/awesome-academy/bookstore/branches{/branch}","tags_url":"https://api.github.com/repos/awesome-academy/bookstore/tags","blobs_url":"https://api.github.com/repos/awesome-academy/bookstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awesome-academy/bookstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awesome-academy/bookstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/awesome-academy/bookstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awesome-academy/bookstore/statuses/{sha}","languages_url":"https://api.github.com/repos/awesome-academy/bookstore/languages","stargazers_url":"https://api.github.com/repos/awesome-academy/bookstore/stargazers","contributors_url":"https://api.github.com/repos/awesome-academy/bookstore/contributors","subscribers_url":"https://api.github.com/repos/awesome-academy/bookstore/subscribers","subscription_url":"https://api.github.com/repos/awesome-academy/bookstore/subscription","commits_url":"https://api.github.com/repos/awesome-academy/bookstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/awesome-academy/bookstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/awesome-academy/bookstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/awesome-academy/bookstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/awesome-academy/bookstore/contents/{+path}","compare_url":"https://api.github.com/repos/awesome-academy/bookstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awesome-academy/bookstore/merges","archive_url":"https://api.github.com/repos/awesome-academy/bookstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awesome-academy/bookstore/downloads","issues_url":"https://api.github.com/repos/awesome-academy/bookstore/issues{/number}","pulls_url":"https://api.github.com/repos/awesome-academy/bookstore/pulls{/number}","milestones_url":"https://api.github.com/repos/awesome-academy/bookstore/milestones{/number}","notifications_url":"https://api.github.com/repos/awesome-academy/bookstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awesome-academy/bookstore/labels{/name}","releases_url":"https://api.github.com/repos/awesome-academy/bookstore/releases{/id}","deployments_url":"https://api.github.com/repos/awesome-academy/bookstore/deployments","created_at":"2018-10-16T09:08:14Z","updated_at":"2018-11-05T04:36:32Z","pushed_at":"2018-11-05T06:44:54Z","git_url":"git://github.com/awesome-academy/bookstore.git","ssh_url":"git@github.com:awesome-academy/bookstore.git","clone_url":"https://github.com/awesome-academy/bookstore.git","svn_url":"https://github.com/awesome-academy/bookstore","homepage":null,"size":8632,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/awesome-academy/bookstore/pulls/21"},"html":{"href":"https://github.com/awesome-academy/bookstore/pull/21"},"issue":{"href":"https://api.github.com/repos/awesome-academy/bookstore/issues/21"},"comments":{"href":"https://api.github.com/repos/awesome-academy/bookstore/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/awesome-academy/bookstore/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/awesome-academy/bookstore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awesome-academy/bookstore/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/awesome-academy/bookstore/statuses/58799444dc9ee252b695a212597b33916bb6a380"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"huongnguyenmta"}}