{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/tms_38/pulls/comments/44378291","id":44378291,"diff_hunk":"@@ -0,0 +1,48 @@\n+class Supervisor::UsersController < ApplicationController\n+  before_action :load_user, except: [:index, :create, :new]\n+\n+  def index\n+    @users = User.send(params[:role].pluralize).paginate page: params[:page]\n+  end\n+\n+  def show\n+    @user = User.find params[:id]\n+  end\n+\n+  def new\n+    @user = User.new\n+  end\n+\n+  def create\n+    @user = User.new user_params\n+    @user.attributes = {role: \"trainee\"}\n+    if @user.save\n+      flash[:success] = t(:add_trainee_sucessful_message)\n+      redirect_to supervisor_users_path(role: \"trainee\")","path":"app/controllers/supervisor/users_controller.rb","position":21,"original_position":21,"commit_id":"d31ad4e03748271d53b28d71b0d6515cb1348221","original_commit_id":"d31ad4e03748271d53b28d71b0d6515cb1348221","user":{"login":"chuanhtuan","id":5590771,"avatar_url":"https://avatars.githubusercontent.com/u/5590771?v=3","gravatar_id":"","url":"https://api.github.com/users/chuanhtuan","html_url":"https://github.com/chuanhtuan","followers_url":"https://api.github.com/users/chuanhtuan/followers","following_url":"https://api.github.com/users/chuanhtuan/following{/other_user}","gists_url":"https://api.github.com/users/chuanhtuan/gists{/gist_id}","starred_url":"https://api.github.com/users/chuanhtuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuanhtuan/subscriptions","organizations_url":"https://api.github.com/users/chuanhtuan/orgs","repos_url":"https://api.github.com/users/chuanhtuan/repos","events_url":"https://api.github.com/users/chuanhtuan/events{/privacy}","received_events_url":"https://api.github.com/users/chuanhtuan/received_events","type":"User","site_admin":false},"body":"should define a constant in model\r\nUser::ROLE[:trainee]  will return \"trainee\"","created_at":"2015-11-10T07:58:58Z","updated_at":"2015-11-10T07:58:58Z","html_url":"https://github.com/framgia/tms_38/pull/5#discussion_r44378291","pull_request_url":"https://api.github.com/repos/framgia/tms_38/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/framgia/tms_38/pulls/comments/44378291"},"html":{"href":"https://github.com/framgia/tms_38/pull/5#discussion_r44378291"},"pull_request":{"href":"https://api.github.com/repos/framgia/tms_38/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/tms_38/pulls/5","id":50222119,"html_url":"https://github.com/framgia/tms_38/pull/5","diff_url":"https://github.com/framgia/tms_38/pull/5.diff","patch_url":"https://github.com/framgia/tms_38/pull/5.patch","issue_url":"https://api.github.com/repos/framgia/tms_38/issues/5","number":5,"state":"open","locked":false,"title":"supervisor namespace and delete trainee","user":{"login":"MuhammadTamzid","id":14922233,"avatar_url":"https://avatars.githubusercontent.com/u/14922233?v=3","gravatar_id":"","url":"https://api.github.com/users/MuhammadTamzid","html_url":"https://github.com/MuhammadTamzid","followers_url":"https://api.github.com/users/MuhammadTamzid/followers","following_url":"https://api.github.com/users/MuhammadTamzid/following{/other_user}","gists_url":"https://api.github.com/users/MuhammadTamzid/gists{/gist_id}","starred_url":"https://api.github.com/users/MuhammadTamzid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MuhammadTamzid/subscriptions","organizations_url":"https://api.github.com/users/MuhammadTamzid/orgs","repos_url":"https://api.github.com/users/MuhammadTamzid/repos","events_url":"https://api.github.com/users/MuhammadTamzid/events{/privacy}","received_events_url":"https://api.github.com/users/MuhammadTamzid/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-10T07:25:28Z","updated_at":"2015-11-10T07:58:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35f92c1d796fd77b41072c88b0a06fe213c36510","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/framgia/tms_38/pulls/5/commits","review_comments_url":"https://api.github.com/repos/framgia/tms_38/pulls/5/comments","review_comment_url":"https://api.github.com/repos/framgia/tms_38/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/tms_38/issues/5/comments","statuses_url":"https://api.github.com/repos/framgia/tms_38/statuses/d31ad4e03748271d53b28d71b0d6515cb1348221","head":{"label":"MuhammadTamzid:44342_delete_trainee","ref":"44342_delete_trainee","sha":"d31ad4e03748271d53b28d71b0d6515cb1348221","user":{"login":"MuhammadTamzid","id":14922233,"avatar_url":"https://avatars.githubusercontent.com/u/14922233?v=3","gravatar_id":"","url":"https://api.github.com/users/MuhammadTamzid","html_url":"https://github.com/MuhammadTamzid","followers_url":"https://api.github.com/users/MuhammadTamzid/followers","following_url":"https://api.github.com/users/MuhammadTamzid/following{/other_user}","gists_url":"https://api.github.com/users/MuhammadTamzid/gists{/gist_id}","starred_url":"https://api.github.com/users/MuhammadTamzid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MuhammadTamzid/subscriptions","organizations_url":"https://api.github.com/users/MuhammadTamzid/orgs","repos_url":"https://api.github.com/users/MuhammadTamzid/repos","events_url":"https://api.github.com/users/MuhammadTamzid/events{/privacy}","received_events_url":"https://api.github.com/users/MuhammadTamzid/received_events","type":"User","site_admin":false},"repo":{"id":45591541,"name":"tms_38","full_name":"MuhammadTamzid/tms_38","owner":{"login":"MuhammadTamzid","id":14922233,"avatar_url":"https://avatars.githubusercontent.com/u/14922233?v=3","gravatar_id":"","url":"https://api.github.com/users/MuhammadTamzid","html_url":"https://github.com/MuhammadTamzid","followers_url":"https://api.github.com/users/MuhammadTamzid/followers","following_url":"https://api.github.com/users/MuhammadTamzid/following{/other_user}","gists_url":"https://api.github.com/users/MuhammadTamzid/gists{/gist_id}","starred_url":"https://api.github.com/users/MuhammadTamzid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MuhammadTamzid/subscriptions","organizations_url":"https://api.github.com/users/MuhammadTamzid/orgs","repos_url":"https://api.github.com/users/MuhammadTamzid/repos","events_url":"https://api.github.com/users/MuhammadTamzid/events{/privacy}","received_events_url":"https://api.github.com/users/MuhammadTamzid/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MuhammadTamzid/tms_38","description":"Framgia Training Management System (training)","fork":true,"url":"https://api.github.com/repos/MuhammadTamzid/tms_38","forks_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/forks","keys_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/teams","hooks_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/hooks","issue_events_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/issues/events{/number}","events_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/events","assignees_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/assignees{/user}","branches_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/branches{/branch}","tags_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/tags","blobs_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/git/refs{/sha}","trees_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/statuses/{sha}","languages_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/languages","stargazers_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/stargazers","contributors_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/contributors","subscribers_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/subscribers","subscription_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/subscription","commits_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/commits{/sha}","git_commits_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/git/commits{/sha}","comments_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/comments{/number}","issue_comment_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/issues/comments{/number}","contents_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/contents/{+path}","compare_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/merges","archive_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/downloads","issues_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/issues{/number}","pulls_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/pulls{/number}","milestones_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/milestones{/number}","notifications_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/labels{/name}","releases_url":"https://api.github.com/repos/MuhammadTamzid/tms_38/releases{/id}","created_at":"2015-11-05T06:09:28Z","updated_at":"2015-11-02T09:23:19Z","pushed_at":"2015-11-10T07:24:31Z","git_url":"git://github.com/MuhammadTamzid/tms_38.git","ssh_url":"git@github.com:MuhammadTamzid/tms_38.git","clone_url":"https://github.com/MuhammadTamzid/tms_38.git","svn_url":"https://github.com/MuhammadTamzid/tms_38","homepage":null,"size":124,"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":"c58596628965ddbc6225e32c32697f373e53061d","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":45384495,"name":"tms_38","full_name":"framgia/tms_38","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/tms_38","description":"Framgia Training Management System (training)","fork":false,"url":"https://api.github.com/repos/framgia/tms_38","forks_url":"https://api.github.com/repos/framgia/tms_38/forks","keys_url":"https://api.github.com/repos/framgia/tms_38/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/tms_38/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/tms_38/teams","hooks_url":"https://api.github.com/repos/framgia/tms_38/hooks","issue_events_url":"https://api.github.com/repos/framgia/tms_38/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/tms_38/events","assignees_url":"https://api.github.com/repos/framgia/tms_38/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/tms_38/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/tms_38/tags","blobs_url":"https://api.github.com/repos/framgia/tms_38/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/tms_38/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/tms_38/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/tms_38/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/tms_38/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/tms_38/languages","stargazers_url":"https://api.github.com/repos/framgia/tms_38/stargazers","contributors_url":"https://api.github.com/repos/framgia/tms_38/contributors","subscribers_url":"https://api.github.com/repos/framgia/tms_38/subscribers","subscription_url":"https://api.github.com/repos/framgia/tms_38/subscription","commits_url":"https://api.github.com/repos/framgia/tms_38/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/tms_38/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/tms_38/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/tms_38/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/tms_38/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/tms_38/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/tms_38/merges","archive_url":"https://api.github.com/repos/framgia/tms_38/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/tms_38/downloads","issues_url":"https://api.github.com/repos/framgia/tms_38/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/tms_38/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/tms_38/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/tms_38/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/tms_38/labels{/name}","releases_url":"https://api.github.com/repos/framgia/tms_38/releases{/id}","created_at":"2015-11-02T09:23:19Z","updated_at":"2015-11-02T09:23:19Z","pushed_at":"2015-11-10T07:25:28Z","git_url":"git://github.com/framgia/tms_38.git","ssh_url":"git@github.com:framgia/tms_38.git","clone_url":"https://github.com/framgia/tms_38.git","svn_url":"https://github.com/framgia/tms_38","homepage":null,"size":333,"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":1,"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/tms_38/pulls/5"},"html":{"href":"https://github.com/framgia/tms_38/pull/5"},"issue":{"href":"https://api.github.com/repos/framgia/tms_38/issues/5"},"comments":{"href":"https://api.github.com/repos/framgia/tms_38/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/tms_38/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/tms_38/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/tms_38/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/tms_38/statuses/d31ad4e03748271d53b28d71b0d6515cb1348221"}}}}