{"action":"created","comment":{"url":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls/comments/208071697","pull_request_review_id":143809465,"id":208071697,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODA3MTY5Nw==","diff_hunk":"@@ -0,0 +1,58 @@\n+class PasswordResetsController < ApplicationController\n+  before_action :get_user,   only: %i(edit update)\n+  before_action :valid_user, only: %i(edit update)\n+  before_action :check_expiration, only: %i(edit update)\n+\n+  def new; end\n+\n+  def create\n+    @user = User.find_by email: params[:password_reset][:email].downcase \n+    if @user\n+      @user.create_reset_digest\n+      @user.send_password_reset_email\n+      flash[:info] = t(\"controller.password_resets.email.sent\")\n+      redirect_to root_url\n+    else\n+      flash.now[:danger] = t(\"controller.password_resets.email_not_found\")\n+      render :new\n+    end\n+  end\n+\n+  def edit; end\n+\n+  def update\n+    if params[:user][:password].empty?\n+      @user.error.add :password, t(\"controller.password_resets.error_update\")\n+      render :edit\n+    elsif @user.update_attributes user_params\n+      log_in @user\n+      flash[:success] = t \"controller.password_resets.success_update\"\n+      redirect_to @user\n+    else\n+      render :edit\n+    end\n+  end\n+\n+  private\n+\n+  def user_params\n+      params.require(:user).permit :password, :password_confirmation\n+  end\n+\n+  def get_user\n+      @user = User.find_by email: params[:email]\n+  end\n+\n+  def valid_user\n+    unless (@user && @user.activated? && @user.authenticated?(:reset, params[:id]))","path":"app/controllers/password_resets_controller.rb","position":47,"original_position":47,"commit_id":"d38d96bdb71860d0d819b3e606a713a1e025c1af","original_commit_id":"d38d96bdb71860d0d819b3e606a713a1e025c1af","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":"use return if insted of unless","created_at":"2018-08-07T01:06:48Z","updated_at":"2018-08-07T01:06:48Z","html_url":"https://github.com/thanhconguet214/Sample_test/pull/7#discussion_r208071697","pull_request_url":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls/7","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls/comments/208071697"},"html":{"href":"https://github.com/thanhconguet214/Sample_test/pull/7#discussion_r208071697"},"pull_request":{"href":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls/7","id":206443548,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NDQzNTQ4","html_url":"https://github.com/thanhconguet214/Sample_test/pull/7","diff_url":"https://github.com/thanhconguet214/Sample_test/pull/7.diff","patch_url":"https://github.com/thanhconguet214/Sample_test/pull/7.patch","issue_url":"https://api.github.com/repos/thanhconguet214/Sample_test/issues/7","number":7,"state":"open","locked":false,"title":"Add password reset","user":{"login":"thanhconguet214","id":41273445,"node_id":"MDQ6VXNlcjQxMjczNDQ1","avatar_url":"https://avatars1.githubusercontent.com/u/41273445?v=4","gravatar_id":"","url":"https://api.github.com/users/thanhconguet214","html_url":"https://github.com/thanhconguet214","followers_url":"https://api.github.com/users/thanhconguet214/followers","following_url":"https://api.github.com/users/thanhconguet214/following{/other_user}","gists_url":"https://api.github.com/users/thanhconguet214/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhconguet214/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhconguet214/subscriptions","organizations_url":"https://api.github.com/users/thanhconguet214/orgs","repos_url":"https://api.github.com/users/thanhconguet214/repos","events_url":"https://api.github.com/users/thanhconguet214/events{/privacy}","received_events_url":"https://api.github.com/users/thanhconguet214/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-06T15:54:45Z","updated_at":"2018-08-07T01:06:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7094d42aa7dd1b886016497351ead4df79782ea","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls/7/commits","review_comments_url":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls/7/comments","review_comment_url":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thanhconguet214/Sample_test/issues/7/comments","statuses_url":"https://api.github.com/repos/thanhconguet214/Sample_test/statuses/d38d96bdb71860d0d819b3e606a713a1e025c1af","head":{"label":"thanhconguet214:password-reset","ref":"password-reset","sha":"d38d96bdb71860d0d819b3e606a713a1e025c1af","user":{"login":"thanhconguet214","id":41273445,"node_id":"MDQ6VXNlcjQxMjczNDQ1","avatar_url":"https://avatars1.githubusercontent.com/u/41273445?v=4","gravatar_id":"","url":"https://api.github.com/users/thanhconguet214","html_url":"https://github.com/thanhconguet214","followers_url":"https://api.github.com/users/thanhconguet214/followers","following_url":"https://api.github.com/users/thanhconguet214/following{/other_user}","gists_url":"https://api.github.com/users/thanhconguet214/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhconguet214/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhconguet214/subscriptions","organizations_url":"https://api.github.com/users/thanhconguet214/orgs","repos_url":"https://api.github.com/users/thanhconguet214/repos","events_url":"https://api.github.com/users/thanhconguet214/events{/privacy}","received_events_url":"https://api.github.com/users/thanhconguet214/received_events","type":"User","site_admin":false},"repo":{"id":142257436,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIyNTc0MzY=","name":"Sample_test","full_name":"thanhconguet214/Sample_test","owner":{"login":"thanhconguet214","id":41273445,"node_id":"MDQ6VXNlcjQxMjczNDQ1","avatar_url":"https://avatars1.githubusercontent.com/u/41273445?v=4","gravatar_id":"","url":"https://api.github.com/users/thanhconguet214","html_url":"https://github.com/thanhconguet214","followers_url":"https://api.github.com/users/thanhconguet214/followers","following_url":"https://api.github.com/users/thanhconguet214/following{/other_user}","gists_url":"https://api.github.com/users/thanhconguet214/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhconguet214/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhconguet214/subscriptions","organizations_url":"https://api.github.com/users/thanhconguet214/orgs","repos_url":"https://api.github.com/users/thanhconguet214/repos","events_url":"https://api.github.com/users/thanhconguet214/events{/privacy}","received_events_url":"https://api.github.com/users/thanhconguet214/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thanhconguet214/Sample_test","description":null,"fork":false,"url":"https://api.github.com/repos/thanhconguet214/Sample_test","forks_url":"https://api.github.com/repos/thanhconguet214/Sample_test/forks","keys_url":"https://api.github.com/repos/thanhconguet214/Sample_test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thanhconguet214/Sample_test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thanhconguet214/Sample_test/teams","hooks_url":"https://api.github.com/repos/thanhconguet214/Sample_test/hooks","issue_events_url":"https://api.github.com/repos/thanhconguet214/Sample_test/issues/events{/number}","events_url":"https://api.github.com/repos/thanhconguet214/Sample_test/events","assignees_url":"https://api.github.com/repos/thanhconguet214/Sample_test/assignees{/user}","branches_url":"https://api.github.com/repos/thanhconguet214/Sample_test/branches{/branch}","tags_url":"https://api.github.com/repos/thanhconguet214/Sample_test/tags","blobs_url":"https://api.github.com/repos/thanhconguet214/Sample_test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thanhconguet214/Sample_test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thanhconguet214/Sample_test/git/refs{/sha}","trees_url":"https://api.github.com/repos/thanhconguet214/Sample_test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thanhconguet214/Sample_test/statuses/{sha}","languages_url":"https://api.github.com/repos/thanhconguet214/Sample_test/languages","stargazers_url":"https://api.github.com/repos/thanhconguet214/Sample_test/stargazers","contributors_url":"https://api.github.com/repos/thanhconguet214/Sample_test/contributors","subscribers_url":"https://api.github.com/repos/thanhconguet214/Sample_test/subscribers","subscription_url":"https://api.github.com/repos/thanhconguet214/Sample_test/subscription","commits_url":"https://api.github.com/repos/thanhconguet214/Sample_test/commits{/sha}","git_commits_url":"https://api.github.com/repos/thanhconguet214/Sample_test/git/commits{/sha}","comments_url":"https://api.github.com/repos/thanhconguet214/Sample_test/comments{/number}","issue_comment_url":"https://api.github.com/repos/thanhconguet214/Sample_test/issues/comments{/number}","contents_url":"https://api.github.com/repos/thanhconguet214/Sample_test/contents/{+path}","compare_url":"https://api.github.com/repos/thanhconguet214/Sample_test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thanhconguet214/Sample_test/merges","archive_url":"https://api.github.com/repos/thanhconguet214/Sample_test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thanhconguet214/Sample_test/downloads","issues_url":"https://api.github.com/repos/thanhconguet214/Sample_test/issues{/number}","pulls_url":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls{/number}","milestones_url":"https://api.github.com/repos/thanhconguet214/Sample_test/milestones{/number}","notifications_url":"https://api.github.com/repos/thanhconguet214/Sample_test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thanhconguet214/Sample_test/labels{/name}","releases_url":"https://api.github.com/repos/thanhconguet214/Sample_test/releases{/id}","deployments_url":"https://api.github.com/repos/thanhconguet214/Sample_test/deployments","created_at":"2018-07-25T06:31:06Z","updated_at":"2018-08-06T09:32:22Z","pushed_at":"2018-08-06T15:54:45Z","git_url":"git://github.com/thanhconguet214/Sample_test.git","ssh_url":"git@github.com:thanhconguet214/Sample_test.git","clone_url":"https://github.com/thanhconguet214/Sample_test.git","svn_url":"https://github.com/thanhconguet214/Sample_test","homepage":null,"size":82,"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":"thanhconguet214:master","ref":"master","sha":"944bd26c050cf34b64e6fcc4594e93a70df500ca","user":{"login":"thanhconguet214","id":41273445,"node_id":"MDQ6VXNlcjQxMjczNDQ1","avatar_url":"https://avatars1.githubusercontent.com/u/41273445?v=4","gravatar_id":"","url":"https://api.github.com/users/thanhconguet214","html_url":"https://github.com/thanhconguet214","followers_url":"https://api.github.com/users/thanhconguet214/followers","following_url":"https://api.github.com/users/thanhconguet214/following{/other_user}","gists_url":"https://api.github.com/users/thanhconguet214/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhconguet214/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhconguet214/subscriptions","organizations_url":"https://api.github.com/users/thanhconguet214/orgs","repos_url":"https://api.github.com/users/thanhconguet214/repos","events_url":"https://api.github.com/users/thanhconguet214/events{/privacy}","received_events_url":"https://api.github.com/users/thanhconguet214/received_events","type":"User","site_admin":false},"repo":{"id":142257436,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIyNTc0MzY=","name":"Sample_test","full_name":"thanhconguet214/Sample_test","owner":{"login":"thanhconguet214","id":41273445,"node_id":"MDQ6VXNlcjQxMjczNDQ1","avatar_url":"https://avatars1.githubusercontent.com/u/41273445?v=4","gravatar_id":"","url":"https://api.github.com/users/thanhconguet214","html_url":"https://github.com/thanhconguet214","followers_url":"https://api.github.com/users/thanhconguet214/followers","following_url":"https://api.github.com/users/thanhconguet214/following{/other_user}","gists_url":"https://api.github.com/users/thanhconguet214/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhconguet214/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhconguet214/subscriptions","organizations_url":"https://api.github.com/users/thanhconguet214/orgs","repos_url":"https://api.github.com/users/thanhconguet214/repos","events_url":"https://api.github.com/users/thanhconguet214/events{/privacy}","received_events_url":"https://api.github.com/users/thanhconguet214/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thanhconguet214/Sample_test","description":null,"fork":false,"url":"https://api.github.com/repos/thanhconguet214/Sample_test","forks_url":"https://api.github.com/repos/thanhconguet214/Sample_test/forks","keys_url":"https://api.github.com/repos/thanhconguet214/Sample_test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thanhconguet214/Sample_test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thanhconguet214/Sample_test/teams","hooks_url":"https://api.github.com/repos/thanhconguet214/Sample_test/hooks","issue_events_url":"https://api.github.com/repos/thanhconguet214/Sample_test/issues/events{/number}","events_url":"https://api.github.com/repos/thanhconguet214/Sample_test/events","assignees_url":"https://api.github.com/repos/thanhconguet214/Sample_test/assignees{/user}","branches_url":"https://api.github.com/repos/thanhconguet214/Sample_test/branches{/branch}","tags_url":"https://api.github.com/repos/thanhconguet214/Sample_test/tags","blobs_url":"https://api.github.com/repos/thanhconguet214/Sample_test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thanhconguet214/Sample_test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thanhconguet214/Sample_test/git/refs{/sha}","trees_url":"https://api.github.com/repos/thanhconguet214/Sample_test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thanhconguet214/Sample_test/statuses/{sha}","languages_url":"https://api.github.com/repos/thanhconguet214/Sample_test/languages","stargazers_url":"https://api.github.com/repos/thanhconguet214/Sample_test/stargazers","contributors_url":"https://api.github.com/repos/thanhconguet214/Sample_test/contributors","subscribers_url":"https://api.github.com/repos/thanhconguet214/Sample_test/subscribers","subscription_url":"https://api.github.com/repos/thanhconguet214/Sample_test/subscription","commits_url":"https://api.github.com/repos/thanhconguet214/Sample_test/commits{/sha}","git_commits_url":"https://api.github.com/repos/thanhconguet214/Sample_test/git/commits{/sha}","comments_url":"https://api.github.com/repos/thanhconguet214/Sample_test/comments{/number}","issue_comment_url":"https://api.github.com/repos/thanhconguet214/Sample_test/issues/comments{/number}","contents_url":"https://api.github.com/repos/thanhconguet214/Sample_test/contents/{+path}","compare_url":"https://api.github.com/repos/thanhconguet214/Sample_test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thanhconguet214/Sample_test/merges","archive_url":"https://api.github.com/repos/thanhconguet214/Sample_test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thanhconguet214/Sample_test/downloads","issues_url":"https://api.github.com/repos/thanhconguet214/Sample_test/issues{/number}","pulls_url":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls{/number}","milestones_url":"https://api.github.com/repos/thanhconguet214/Sample_test/milestones{/number}","notifications_url":"https://api.github.com/repos/thanhconguet214/Sample_test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thanhconguet214/Sample_test/labels{/name}","releases_url":"https://api.github.com/repos/thanhconguet214/Sample_test/releases{/id}","deployments_url":"https://api.github.com/repos/thanhconguet214/Sample_test/deployments","created_at":"2018-07-25T06:31:06Z","updated_at":"2018-08-06T09:32:22Z","pushed_at":"2018-08-06T15:54:45Z","git_url":"git://github.com/thanhconguet214/Sample_test.git","ssh_url":"git@github.com:thanhconguet214/Sample_test.git","clone_url":"https://github.com/thanhconguet214/Sample_test.git","svn_url":"https://github.com/thanhconguet214/Sample_test","homepage":null,"size":82,"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/thanhconguet214/Sample_test/pulls/7"},"html":{"href":"https://github.com/thanhconguet214/Sample_test/pull/7"},"issue":{"href":"https://api.github.com/repos/thanhconguet214/Sample_test/issues/7"},"comments":{"href":"https://api.github.com/repos/thanhconguet214/Sample_test/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thanhconguet214/Sample_test/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/thanhconguet214/Sample_test/statuses/d38d96bdb71860d0d819b3e606a713a1e025c1af"}},"author_association":"OWNER"}}
{"actor":{"display_login":"huuphuc93"}}