{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/drs_3/pulls/comments/81050781","pull_request_review_id":2059577,"id":81050781,"diff_hunk":"@@ -1,8 +1,61 @@\n class Admin::UsersController < ApplicationController\n+  before_action :find_user, except: [:index, :new, :create]\n   after_action :verify_authorized\n \n   def index\n     @users = User.all.paginate page: params[:page], per_page: Settings.page\n     authorize User\n   end\n+\n+  def show\n+    authorize @user\n+  end\n+\n+  def edit\n+    authorize @user\n+    load_data\n+  end\n+\n+  def update\n+    authorize @user\n+    if @user.update_attributes user_params\n+      if @user.check_manager\n+        @user.manager!\n+        flash[:success] = t \"notification.success\"\n+        redirect_to admin_users_path\n+      end\n+    else\n+      flash[:danger] = t \"notification.fail\"\n+      render :edit\n+    end\n+  end\n+\n+  def destroy\n+    authorize @user\n+    if @user.destroy\n+      flash[:success] = t \"notification.destroy_success\"\n+    else\n+      flash[:danger] = t \"notification.destroy_fail\"\n+    end\n+    redirect_to admin_users_path\n+  end\n+\n+  private\n+  def user_params\n+    params.require(:user).permit :name, :position_id, :division_id, :role\n+  end\n+\n+  def load_data\n+    Settings.models.each do |model|\n+      instance_variable_set \"@#{(eval model).table_name}\", (eval model).all","path":"app/controllers/admin/users_controller.rb","position":50,"original_position":50,"commit_id":"32b26e809d83ec992c446dc3913dc60f9f3cda3c","original_commit_id":"32b26e809d83ec992c446dc3913dc60f9f3cda3c","user":{"login":"hellovietnam93","id":8023606,"avatar_url":"https://avatars.githubusercontent.com/u/8023606?v=3","gravatar_id":"","url":"https://api.github.com/users/hellovietnam93","html_url":"https://github.com/hellovietnam93","followers_url":"https://api.github.com/users/hellovietnam93/followers","following_url":"https://api.github.com/users/hellovietnam93/following{/other_user}","gists_url":"https://api.github.com/users/hellovietnam93/gists{/gist_id}","starred_url":"https://api.github.com/users/hellovietnam93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellovietnam93/subscriptions","organizations_url":"https://api.github.com/users/hellovietnam93/orgs","repos_url":"https://api.github.com/users/hellovietnam93/repos","events_url":"https://api.github.com/users/hellovietnam93/events{/privacy}","received_events_url":"https://api.github.com/users/hellovietnam93/received_events","type":"User","site_admin":false},"body":"cần j eval?","created_at":"2016-09-29T01:28:36Z","updated_at":"2016-09-29T01:29:33Z","html_url":"https://github.com/framgia/drs_3/pull/8#discussion_r81050781","pull_request_url":"https://api.github.com/repos/framgia/drs_3/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/framgia/drs_3/pulls/comments/81050781"},"html":{"href":"https://github.com/framgia/drs_3/pull/8#discussion_r81050781"},"pull_request":{"href":"https://api.github.com/repos/framgia/drs_3/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/drs_3/pulls/8","id":86890928,"html_url":"https://github.com/framgia/drs_3/pull/8","diff_url":"https://github.com/framgia/drs_3/pull/8.diff","patch_url":"https://github.com/framgia/drs_3/pull/8.patch","issue_url":"https://api.github.com/repos/framgia/drs_3/issues/8","number":8,"state":"open","locked":false,"title":"Admin make user to manager","user":{"login":"yeunuthongminh","id":20291773,"avatar_url":"https://avatars.githubusercontent.com/u/20291773?v=3","gravatar_id":"","url":"https://api.github.com/users/yeunuthongminh","html_url":"https://github.com/yeunuthongminh","followers_url":"https://api.github.com/users/yeunuthongminh/followers","following_url":"https://api.github.com/users/yeunuthongminh/following{/other_user}","gists_url":"https://api.github.com/users/yeunuthongminh/gists{/gist_id}","starred_url":"https://api.github.com/users/yeunuthongminh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeunuthongminh/subscriptions","organizations_url":"https://api.github.com/users/yeunuthongminh/orgs","repos_url":"https://api.github.com/users/yeunuthongminh/repos","events_url":"https://api.github.com/users/yeunuthongminh/events{/privacy}","received_events_url":"https://api.github.com/users/yeunuthongminh/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-27T09:18:36Z","updated_at":"2016-09-29T01:29:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17e9f4ce1276cbd67f059898f144a97abe6a3865","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/drs_3/pulls/8/commits","review_comments_url":"https://api.github.com/repos/framgia/drs_3/pulls/8/comments","review_comment_url":"https://api.github.com/repos/framgia/drs_3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/drs_3/issues/8/comments","statuses_url":"https://api.github.com/repos/framgia/drs_3/statuses/32b26e809d83ec992c446dc3913dc60f9f3cda3c","head":{"label":"yeunuthongminh:admin_make_user_to_manager","ref":"admin_make_user_to_manager","sha":"32b26e809d83ec992c446dc3913dc60f9f3cda3c","user":{"login":"yeunuthongminh","id":20291773,"avatar_url":"https://avatars.githubusercontent.com/u/20291773?v=3","gravatar_id":"","url":"https://api.github.com/users/yeunuthongminh","html_url":"https://github.com/yeunuthongminh","followers_url":"https://api.github.com/users/yeunuthongminh/followers","following_url":"https://api.github.com/users/yeunuthongminh/following{/other_user}","gists_url":"https://api.github.com/users/yeunuthongminh/gists{/gist_id}","starred_url":"https://api.github.com/users/yeunuthongminh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeunuthongminh/subscriptions","organizations_url":"https://api.github.com/users/yeunuthongminh/orgs","repos_url":"https://api.github.com/users/yeunuthongminh/repos","events_url":"https://api.github.com/users/yeunuthongminh/events{/privacy}","received_events_url":"https://api.github.com/users/yeunuthongminh/received_events","type":"User","site_admin":false},"repo":{"id":68684438,"name":"drs_3","full_name":"yeunuthongminh/drs_3","owner":{"login":"yeunuthongminh","id":20291773,"avatar_url":"https://avatars.githubusercontent.com/u/20291773?v=3","gravatar_id":"","url":"https://api.github.com/users/yeunuthongminh","html_url":"https://github.com/yeunuthongminh","followers_url":"https://api.github.com/users/yeunuthongminh/followers","following_url":"https://api.github.com/users/yeunuthongminh/following{/other_user}","gists_url":"https://api.github.com/users/yeunuthongminh/gists{/gist_id}","starred_url":"https://api.github.com/users/yeunuthongminh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeunuthongminh/subscriptions","organizations_url":"https://api.github.com/users/yeunuthongminh/orgs","repos_url":"https://api.github.com/users/yeunuthongminh/repos","events_url":"https://api.github.com/users/yeunuthongminh/events{/privacy}","received_events_url":"https://api.github.com/users/yeunuthongminh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yeunuthongminh/drs_3","description":"Daily Report System","fork":true,"url":"https://api.github.com/repos/yeunuthongminh/drs_3","forks_url":"https://api.github.com/repos/yeunuthongminh/drs_3/forks","keys_url":"https://api.github.com/repos/yeunuthongminh/drs_3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yeunuthongminh/drs_3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yeunuthongminh/drs_3/teams","hooks_url":"https://api.github.com/repos/yeunuthongminh/drs_3/hooks","issue_events_url":"https://api.github.com/repos/yeunuthongminh/drs_3/issues/events{/number}","events_url":"https://api.github.com/repos/yeunuthongminh/drs_3/events","assignees_url":"https://api.github.com/repos/yeunuthongminh/drs_3/assignees{/user}","branches_url":"https://api.github.com/repos/yeunuthongminh/drs_3/branches{/branch}","tags_url":"https://api.github.com/repos/yeunuthongminh/drs_3/tags","blobs_url":"https://api.github.com/repos/yeunuthongminh/drs_3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yeunuthongminh/drs_3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yeunuthongminh/drs_3/git/refs{/sha}","trees_url":"https://api.github.com/repos/yeunuthongminh/drs_3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yeunuthongminh/drs_3/statuses/{sha}","languages_url":"https://api.github.com/repos/yeunuthongminh/drs_3/languages","stargazers_url":"https://api.github.com/repos/yeunuthongminh/drs_3/stargazers","contributors_url":"https://api.github.com/repos/yeunuthongminh/drs_3/contributors","subscribers_url":"https://api.github.com/repos/yeunuthongminh/drs_3/subscribers","subscription_url":"https://api.github.com/repos/yeunuthongminh/drs_3/subscription","commits_url":"https://api.github.com/repos/yeunuthongminh/drs_3/commits{/sha}","git_commits_url":"https://api.github.com/repos/yeunuthongminh/drs_3/git/commits{/sha}","comments_url":"https://api.github.com/repos/yeunuthongminh/drs_3/comments{/number}","issue_comment_url":"https://api.github.com/repos/yeunuthongminh/drs_3/issues/comments{/number}","contents_url":"https://api.github.com/repos/yeunuthongminh/drs_3/contents/{+path}","compare_url":"https://api.github.com/repos/yeunuthongminh/drs_3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yeunuthongminh/drs_3/merges","archive_url":"https://api.github.com/repos/yeunuthongminh/drs_3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yeunuthongminh/drs_3/downloads","issues_url":"https://api.github.com/repos/yeunuthongminh/drs_3/issues{/number}","pulls_url":"https://api.github.com/repos/yeunuthongminh/drs_3/pulls{/number}","milestones_url":"https://api.github.com/repos/yeunuthongminh/drs_3/milestones{/number}","notifications_url":"https://api.github.com/repos/yeunuthongminh/drs_3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yeunuthongminh/drs_3/labels{/name}","releases_url":"https://api.github.com/repos/yeunuthongminh/drs_3/releases{/id}","deployments_url":"https://api.github.com/repos/yeunuthongminh/drs_3/deployments","created_at":"2016-09-20T07:11:27Z","updated_at":"2016-09-20T04:08:34Z","pushed_at":"2016-09-29T01:27:32Z","git_url":"git://github.com/yeunuthongminh/drs_3.git","ssh_url":"git@github.com:yeunuthongminh/drs_3.git","clone_url":"https://github.com/yeunuthongminh/drs_3.git","svn_url":"https://github.com/yeunuthongminh/drs_3","homepage":null,"size":73,"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":"2a798995c7f2091a52c592312e04dc38bdbc1cef","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":68672893,"name":"drs_3","full_name":"framgia/drs_3","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/drs_3","description":"Daily Report System","fork":false,"url":"https://api.github.com/repos/framgia/drs_3","forks_url":"https://api.github.com/repos/framgia/drs_3/forks","keys_url":"https://api.github.com/repos/framgia/drs_3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/drs_3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/drs_3/teams","hooks_url":"https://api.github.com/repos/framgia/drs_3/hooks","issue_events_url":"https://api.github.com/repos/framgia/drs_3/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/drs_3/events","assignees_url":"https://api.github.com/repos/framgia/drs_3/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/drs_3/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/drs_3/tags","blobs_url":"https://api.github.com/repos/framgia/drs_3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/drs_3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/drs_3/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/drs_3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/drs_3/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/drs_3/languages","stargazers_url":"https://api.github.com/repos/framgia/drs_3/stargazers","contributors_url":"https://api.github.com/repos/framgia/drs_3/contributors","subscribers_url":"https://api.github.com/repos/framgia/drs_3/subscribers","subscription_url":"https://api.github.com/repos/framgia/drs_3/subscription","commits_url":"https://api.github.com/repos/framgia/drs_3/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/drs_3/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/drs_3/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/drs_3/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/drs_3/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/drs_3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/drs_3/merges","archive_url":"https://api.github.com/repos/framgia/drs_3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/drs_3/downloads","issues_url":"https://api.github.com/repos/framgia/drs_3/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/drs_3/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/drs_3/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/drs_3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/drs_3/labels{/name}","releases_url":"https://api.github.com/repos/framgia/drs_3/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/drs_3/deployments","created_at":"2016-09-20T04:08:34Z","updated_at":"2016-09-20T04:08:34Z","pushed_at":"2016-09-29T01:27:32Z","git_url":"git://github.com/framgia/drs_3.git","ssh_url":"git@github.com:framgia/drs_3.git","clone_url":"https://github.com/framgia/drs_3.git","svn_url":"https://github.com/framgia/drs_3","homepage":null,"size":59,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/drs_3/pulls/8"},"html":{"href":"https://github.com/framgia/drs_3/pull/8"},"issue":{"href":"https://api.github.com/repos/framgia/drs_3/issues/8"},"comments":{"href":"https://api.github.com/repos/framgia/drs_3/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/drs_3/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/drs_3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/drs_3/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/drs_3/statuses/32b26e809d83ec992c446dc3913dc60f9f3cda3c"}}}}
{"actor":{"display_login":"hellovietnam93"}}