{"action":"created","comment":{"url":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls/comments/229580621","pull_request_review_id":170111944,"id":229580621,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTU4MDYyMQ==","diff_hunk":"@@ -1,3 +1,74 @@\n class UsersController < ApplicationController\n-  def new; end\n+  before_action :set_user, only: [:show, :edit, :update, :destroy]\n+\n+  # GET /users\n+  # GET /users.json\n+  def index\n+    @users = User.all\n+  end\n+\n+  # GET /users/1\n+  # GET /users/1.json\n+  def show\n+  end\n+\n+  # GET /users/new\n+  def new\n+    @user = User.new\n+  end\n+\n+  # GET /users/1/edit\n+  def edit\n+  end\n+\n+  # POST /users\n+  # POST /users.json\n+  def create\n+    @user = User.new(user_params)\n+\n+    respond_to do |format|\n+      if @user.save\n+        format.html { redirect_to @user, notice: 'User was successfully created.' }\n+        format.json { render :show, status: :created, location: @user }\n+      else\n+        format.html { render :new }\n+        format.json { render json: @user.errors, status: :unprocessable_entity }\n+      end\n+    end\n+  end\n+\n+  # PATCH/PUT /users/1\n+  # PATCH/PUT /users/1.json\n+  def update\n+    respond_to do |format|\n+      if @user.update(user_params)\n+        format.html { redirect_to @user, notice: 'User was successfully updated.' }\n+        format.json { render :show, status: :ok, location: @user }\n+      else\n+        format.html { render :edit }\n+        format.json { render json: @user.errors, status: :unprocessable_entity }\n+      end\n+    end\n+  end\n+\n+  # DELETE /users/1\n+  # DELETE /users/1.json\n+  def destroy\n+    @user.destroy\n+    respond_to do |format|\n+      format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n+      format.json { head :no_content }\n+    end\n+  end\n+\n+  private\n+    # Use callbacks to share common setup or constraints between actions.\n+    def set_user\n+      @user = User.find(params[:id])","path":"app/controllers/users_controller.rb","position":68,"original_position":68,"commit_id":"05df3d9d35ed51e1bdc141acb21062f93741dedc","original_commit_id":"05df3d9d35ed51e1bdc141acb21062f93741dedc","user":{"login":"huuphuc93","id":32001464,"node_id":"MDQ6VXNlcjMyMDAxNDY0","avatar_url":"https://avatars1.githubusercontent.com/u/32001464?v=4","gravatar_id":"","url":"https://api.github.com/users/huuphuc93","html_url":"https://github.com/huuphuc93","followers_url":"https://api.github.com/users/huuphuc93/followers","following_url":"https://api.github.com/users/huuphuc93/following{/other_user}","gists_url":"https://api.github.com/users/huuphuc93/gists{/gist_id}","starred_url":"https://api.github.com/users/huuphuc93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huuphuc93/subscriptions","organizations_url":"https://api.github.com/users/huuphuc93/orgs","repos_url":"https://api.github.com/users/huuphuc93/repos","events_url":"https://api.github.com/users/huuphuc93/events{/privacy}","received_events_url":"https://api.github.com/users/huuphuc93/received_events","type":"User","site_admin":false},"body":"- Phân biệt find vs find_by","created_at":"2018-10-31T06:57:28Z","updated_at":"2018-10-31T06:57:31Z","html_url":"https://github.com/tuananhvp25081995/sample_app/pull/4#discussion_r229580621","pull_request_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls/4","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls/comments/229580621"},"html":{"href":"https://github.com/tuananhvp25081995/sample_app/pull/4#discussion_r229580621"},"pull_request":{"href":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls/4","id":226954348,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2OTU0MzQ4","html_url":"https://github.com/tuananhvp25081995/sample_app/pull/4","diff_url":"https://github.com/tuananhvp25081995/sample_app/pull/4.diff","patch_url":"https://github.com/tuananhvp25081995/sample_app/pull/4.patch","issue_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/issues/4","number":4,"state":"open","locked":false,"title":"Make a basic User model (including secure passwords)","user":{"login":"tuananhvp25081995","id":40592271,"node_id":"MDQ6VXNlcjQwNTkyMjcx","avatar_url":"https://avatars0.githubusercontent.com/u/40592271?v=4","gravatar_id":"","url":"https://api.github.com/users/tuananhvp25081995","html_url":"https://github.com/tuananhvp25081995","followers_url":"https://api.github.com/users/tuananhvp25081995/followers","following_url":"https://api.github.com/users/tuananhvp25081995/following{/other_user}","gists_url":"https://api.github.com/users/tuananhvp25081995/gists{/gist_id}","starred_url":"https://api.github.com/users/tuananhvp25081995/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuananhvp25081995/subscriptions","organizations_url":"https://api.github.com/users/tuananhvp25081995/orgs","repos_url":"https://api.github.com/users/tuananhvp25081995/repos","events_url":"https://api.github.com/users/tuananhvp25081995/events{/privacy}","received_events_url":"https://api.github.com/users/tuananhvp25081995/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-30T14:51:57Z","updated_at":"2018-10-31T06:57:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b410737335c507273eb80b7e7ff17ef12bb4452c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls/4/commits","review_comments_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls/4/comments","review_comment_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/issues/4/comments","statuses_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/statuses/05df3d9d35ed51e1bdc141acb21062f93741dedc","head":{"label":"tuananhvp25081995:modeling-users","ref":"modeling-users","sha":"05df3d9d35ed51e1bdc141acb21062f93741dedc","user":{"login":"tuananhvp25081995","id":40592271,"node_id":"MDQ6VXNlcjQwNTkyMjcx","avatar_url":"https://avatars0.githubusercontent.com/u/40592271?v=4","gravatar_id":"","url":"https://api.github.com/users/tuananhvp25081995","html_url":"https://github.com/tuananhvp25081995","followers_url":"https://api.github.com/users/tuananhvp25081995/followers","following_url":"https://api.github.com/users/tuananhvp25081995/following{/other_user}","gists_url":"https://api.github.com/users/tuananhvp25081995/gists{/gist_id}","starred_url":"https://api.github.com/users/tuananhvp25081995/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuananhvp25081995/subscriptions","organizations_url":"https://api.github.com/users/tuananhvp25081995/orgs","repos_url":"https://api.github.com/users/tuananhvp25081995/repos","events_url":"https://api.github.com/users/tuananhvp25081995/events{/privacy}","received_events_url":"https://api.github.com/users/tuananhvp25081995/received_events","type":"User","site_admin":false},"repo":{"id":154471546,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQ0NzE1NDY=","name":"sample_app","full_name":"tuananhvp25081995/sample_app","private":false,"owner":{"login":"tuananhvp25081995","id":40592271,"node_id":"MDQ6VXNlcjQwNTkyMjcx","avatar_url":"https://avatars0.githubusercontent.com/u/40592271?v=4","gravatar_id":"","url":"https://api.github.com/users/tuananhvp25081995","html_url":"https://github.com/tuananhvp25081995","followers_url":"https://api.github.com/users/tuananhvp25081995/followers","following_url":"https://api.github.com/users/tuananhvp25081995/following{/other_user}","gists_url":"https://api.github.com/users/tuananhvp25081995/gists{/gist_id}","starred_url":"https://api.github.com/users/tuananhvp25081995/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuananhvp25081995/subscriptions","organizations_url":"https://api.github.com/users/tuananhvp25081995/orgs","repos_url":"https://api.github.com/users/tuananhvp25081995/repos","events_url":"https://api.github.com/users/tuananhvp25081995/events{/privacy}","received_events_url":"https://api.github.com/users/tuananhvp25081995/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tuananhvp25081995/sample_app","description":"Test-rails","fork":false,"url":"https://api.github.com/repos/tuananhvp25081995/sample_app","forks_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/forks","keys_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/teams","hooks_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/hooks","issue_events_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/issues/events{/number}","events_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/events","assignees_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/assignees{/user}","branches_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/branches{/branch}","tags_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/tags","blobs_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/statuses/{sha}","languages_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/languages","stargazers_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/stargazers","contributors_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/contributors","subscribers_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/subscribers","subscription_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/subscription","commits_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/contents/{+path}","compare_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/merges","archive_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/downloads","issues_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/issues{/number}","pulls_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls{/number}","milestones_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/milestones{/number}","notifications_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/labels{/name}","releases_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/releases{/id}","deployments_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/deployments","created_at":"2018-10-24T09:08:00Z","updated_at":"2018-10-30T09:37:44Z","pushed_at":"2018-10-31T06:50:16Z","git_url":"git://github.com/tuananhvp25081995/sample_app.git","ssh_url":"git@github.com:tuananhvp25081995/sample_app.git","clone_url":"https://github.com/tuananhvp25081995/sample_app.git","svn_url":"https://github.com/tuananhvp25081995/sample_app","homepage":null,"size":59,"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":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"tuananhvp25081995:master","ref":"master","sha":"988a05b939ecb6d98c10c182b19e63bb18087802","user":{"login":"tuananhvp25081995","id":40592271,"node_id":"MDQ6VXNlcjQwNTkyMjcx","avatar_url":"https://avatars0.githubusercontent.com/u/40592271?v=4","gravatar_id":"","url":"https://api.github.com/users/tuananhvp25081995","html_url":"https://github.com/tuananhvp25081995","followers_url":"https://api.github.com/users/tuananhvp25081995/followers","following_url":"https://api.github.com/users/tuananhvp25081995/following{/other_user}","gists_url":"https://api.github.com/users/tuananhvp25081995/gists{/gist_id}","starred_url":"https://api.github.com/users/tuananhvp25081995/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuananhvp25081995/subscriptions","organizations_url":"https://api.github.com/users/tuananhvp25081995/orgs","repos_url":"https://api.github.com/users/tuananhvp25081995/repos","events_url":"https://api.github.com/users/tuananhvp25081995/events{/privacy}","received_events_url":"https://api.github.com/users/tuananhvp25081995/received_events","type":"User","site_admin":false},"repo":{"id":154471546,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQ0NzE1NDY=","name":"sample_app","full_name":"tuananhvp25081995/sample_app","private":false,"owner":{"login":"tuananhvp25081995","id":40592271,"node_id":"MDQ6VXNlcjQwNTkyMjcx","avatar_url":"https://avatars0.githubusercontent.com/u/40592271?v=4","gravatar_id":"","url":"https://api.github.com/users/tuananhvp25081995","html_url":"https://github.com/tuananhvp25081995","followers_url":"https://api.github.com/users/tuananhvp25081995/followers","following_url":"https://api.github.com/users/tuananhvp25081995/following{/other_user}","gists_url":"https://api.github.com/users/tuananhvp25081995/gists{/gist_id}","starred_url":"https://api.github.com/users/tuananhvp25081995/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuananhvp25081995/subscriptions","organizations_url":"https://api.github.com/users/tuananhvp25081995/orgs","repos_url":"https://api.github.com/users/tuananhvp25081995/repos","events_url":"https://api.github.com/users/tuananhvp25081995/events{/privacy}","received_events_url":"https://api.github.com/users/tuananhvp25081995/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tuananhvp25081995/sample_app","description":"Test-rails","fork":false,"url":"https://api.github.com/repos/tuananhvp25081995/sample_app","forks_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/forks","keys_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/teams","hooks_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/hooks","issue_events_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/issues/events{/number}","events_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/events","assignees_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/assignees{/user}","branches_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/branches{/branch}","tags_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/tags","blobs_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/statuses/{sha}","languages_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/languages","stargazers_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/stargazers","contributors_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/contributors","subscribers_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/subscribers","subscription_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/subscription","commits_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/contents/{+path}","compare_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/merges","archive_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/downloads","issues_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/issues{/number}","pulls_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls{/number}","milestones_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/milestones{/number}","notifications_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/labels{/name}","releases_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/releases{/id}","deployments_url":"https://api.github.com/repos/tuananhvp25081995/sample_app/deployments","created_at":"2018-10-24T09:08:00Z","updated_at":"2018-10-30T09:37:44Z","pushed_at":"2018-10-31T06:50:16Z","git_url":"git://github.com/tuananhvp25081995/sample_app.git","ssh_url":"git@github.com:tuananhvp25081995/sample_app.git","clone_url":"https://github.com/tuananhvp25081995/sample_app.git","svn_url":"https://github.com/tuananhvp25081995/sample_app","homepage":null,"size":59,"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":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls/4"},"html":{"href":"https://github.com/tuananhvp25081995/sample_app/pull/4"},"issue":{"href":"https://api.github.com/repos/tuananhvp25081995/sample_app/issues/4"},"comments":{"href":"https://api.github.com/repos/tuananhvp25081995/sample_app/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tuananhvp25081995/sample_app/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/tuananhvp25081995/sample_app/statuses/05df3d9d35ed51e1bdc141acb21062f93741dedc"}},"author_association":"OWNER"}}
{"actor":{"display_login":"huuphuc93"}}