{"action":"created","comment":{"url":"https://api.github.com/repos/lylogi/sample_app/pulls/comments/95982683","pull_request_review_id":16554949,"id":95982683,"diff_hunk":"@@ -0,0 +1,61 @@\n+class PasswordResetsController < ApplicationController\n+  before_action :get_user, only: [:edit, :update]\n+  before_action :valid_user, only: [:edit, :update]\n+  before_action :check_expiration, only: [:edit, :update]\n+\n+  def new\n+  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] = \"Email sent with password reset instructions\"\n+      redirect_to root_url\n+    else\n+      flash.now[:danger] = \"Email address not found\"\n+      render :new\n+    end\n+  end\n+\n+  def edit\n+  end\n+\n+  def update\n+    if params[:user][:password].empty?\n+      @user.errors.add :password, \"can't be empty\"\n+      render :edit\n+    elsif @user.update_attributes user_params\n+      log_in @user\n+      @user.update_attribute(:reset_digest, nil)","path":"app/controllers/password_resets_controller.rb","position":31,"original_position":31,"commit_id":"689318b5ac76c75bca6de5311d6893c663107764","original_commit_id":"689318b5ac76c75bca6de5311d6893c663107764","user":{"login":"sangnuce","id":12852873,"avatar_url":"https://avatars.githubusercontent.com/u/12852873?v=3","gravatar_id":"","url":"https://api.github.com/users/sangnuce","html_url":"https://github.com/sangnuce","followers_url":"https://api.github.com/users/sangnuce/followers","following_url":"https://api.github.com/users/sangnuce/following{/other_user}","gists_url":"https://api.github.com/users/sangnuce/gists{/gist_id}","starred_url":"https://api.github.com/users/sangnuce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sangnuce/subscriptions","organizations_url":"https://api.github.com/users/sangnuce/orgs","repos_url":"https://api.github.com/users/sangnuce/repos","events_url":"https://api.github.com/users/sangnuce/events{/privacy}","received_events_url":"https://api.github.com/users/sangnuce/received_events","type":"User","site_admin":false},"body":"bỏ ngoặc + dùng update_attributes chứ không dùng update_attribute nhé.","created_at":"2017-01-13T11:54:01Z","updated_at":"2017-01-13T11:54:01Z","html_url":"https://github.com/lylogi/sample_app/pull/11#discussion_r95982683","pull_request_url":"https://api.github.com/repos/lylogi/sample_app/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/lylogi/sample_app/pulls/comments/95982683"},"html":{"href":"https://github.com/lylogi/sample_app/pull/11#discussion_r95982683"},"pull_request":{"href":"https://api.github.com/repos/lylogi/sample_app/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/lylogi/sample_app/pulls/11","id":101407528,"html_url":"https://github.com/lylogi/sample_app/pull/11","diff_url":"https://github.com/lylogi/sample_app/pull/11.diff","patch_url":"https://github.com/lylogi/sample_app/pull/11.patch","issue_url":"https://api.github.com/repos/lylogi/sample_app/issues/11","number":11,"state":"open","locked":false,"title":"Add password reset","user":{"login":"lylogi","id":14809063,"avatar_url":"https://avatars.githubusercontent.com/u/14809063?v=3","gravatar_id":"","url":"https://api.github.com/users/lylogi","html_url":"https://github.com/lylogi","followers_url":"https://api.github.com/users/lylogi/followers","following_url":"https://api.github.com/users/lylogi/following{/other_user}","gists_url":"https://api.github.com/users/lylogi/gists{/gist_id}","starred_url":"https://api.github.com/users/lylogi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lylogi/subscriptions","organizations_url":"https://api.github.com/users/lylogi/orgs","repos_url":"https://api.github.com/users/lylogi/repos","events_url":"https://api.github.com/users/lylogi/events{/privacy}","received_events_url":"https://api.github.com/users/lylogi/received_events","type":"User","site_admin":false},"body":"chapter 12","created_at":"2017-01-13T08:36:50Z","updated_at":"2017-01-13T11:54:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7eb3de0adf3cbdd38827e805ce046ac519008e34","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/lylogi/sample_app/pulls/11/commits","review_comments_url":"https://api.github.com/repos/lylogi/sample_app/pulls/11/comments","review_comment_url":"https://api.github.com/repos/lylogi/sample_app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lylogi/sample_app/issues/11/comments","statuses_url":"https://api.github.com/repos/lylogi/sample_app/statuses/689318b5ac76c75bca6de5311d6893c663107764","head":{"label":"lylogi:password-reset","ref":"password-reset","sha":"689318b5ac76c75bca6de5311d6893c663107764","user":{"login":"lylogi","id":14809063,"avatar_url":"https://avatars.githubusercontent.com/u/14809063?v=3","gravatar_id":"","url":"https://api.github.com/users/lylogi","html_url":"https://github.com/lylogi","followers_url":"https://api.github.com/users/lylogi/followers","following_url":"https://api.github.com/users/lylogi/following{/other_user}","gists_url":"https://api.github.com/users/lylogi/gists{/gist_id}","starred_url":"https://api.github.com/users/lylogi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lylogi/subscriptions","organizations_url":"https://api.github.com/users/lylogi/orgs","repos_url":"https://api.github.com/users/lylogi/repos","events_url":"https://api.github.com/users/lylogi/events{/privacy}","received_events_url":"https://api.github.com/users/lylogi/received_events","type":"User","site_admin":false},"repo":{"id":77986495,"name":"sample_app","full_name":"lylogi/sample_app","owner":{"login":"lylogi","id":14809063,"avatar_url":"https://avatars.githubusercontent.com/u/14809063?v=3","gravatar_id":"","url":"https://api.github.com/users/lylogi","html_url":"https://github.com/lylogi","followers_url":"https://api.github.com/users/lylogi/followers","following_url":"https://api.github.com/users/lylogi/following{/other_user}","gists_url":"https://api.github.com/users/lylogi/gists{/gist_id}","starred_url":"https://api.github.com/users/lylogi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lylogi/subscriptions","organizations_url":"https://api.github.com/users/lylogi/orgs","repos_url":"https://api.github.com/users/lylogi/repos","events_url":"https://api.github.com/users/lylogi/events{/privacy}","received_events_url":"https://api.github.com/users/lylogi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lylogi/sample_app","description":null,"fork":false,"url":"https://api.github.com/repos/lylogi/sample_app","forks_url":"https://api.github.com/repos/lylogi/sample_app/forks","keys_url":"https://api.github.com/repos/lylogi/sample_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lylogi/sample_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lylogi/sample_app/teams","hooks_url":"https://api.github.com/repos/lylogi/sample_app/hooks","issue_events_url":"https://api.github.com/repos/lylogi/sample_app/issues/events{/number}","events_url":"https://api.github.com/repos/lylogi/sample_app/events","assignees_url":"https://api.github.com/repos/lylogi/sample_app/assignees{/user}","branches_url":"https://api.github.com/repos/lylogi/sample_app/branches{/branch}","tags_url":"https://api.github.com/repos/lylogi/sample_app/tags","blobs_url":"https://api.github.com/repos/lylogi/sample_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lylogi/sample_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lylogi/sample_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/lylogi/sample_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lylogi/sample_app/statuses/{sha}","languages_url":"https://api.github.com/repos/lylogi/sample_app/languages","stargazers_url":"https://api.github.com/repos/lylogi/sample_app/stargazers","contributors_url":"https://api.github.com/repos/lylogi/sample_app/contributors","subscribers_url":"https://api.github.com/repos/lylogi/sample_app/subscribers","subscription_url":"https://api.github.com/repos/lylogi/sample_app/subscription","commits_url":"https://api.github.com/repos/lylogi/sample_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/lylogi/sample_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/lylogi/sample_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/lylogi/sample_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/lylogi/sample_app/contents/{+path}","compare_url":"https://api.github.com/repos/lylogi/sample_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lylogi/sample_app/merges","archive_url":"https://api.github.com/repos/lylogi/sample_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lylogi/sample_app/downloads","issues_url":"https://api.github.com/repos/lylogi/sample_app/issues{/number}","pulls_url":"https://api.github.com/repos/lylogi/sample_app/pulls{/number}","milestones_url":"https://api.github.com/repos/lylogi/sample_app/milestones{/number}","notifications_url":"https://api.github.com/repos/lylogi/sample_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lylogi/sample_app/labels{/name}","releases_url":"https://api.github.com/repos/lylogi/sample_app/releases{/id}","deployments_url":"https://api.github.com/repos/lylogi/sample_app/deployments","created_at":"2017-01-04T06:07:18Z","updated_at":"2017-01-04T06:08:33Z","pushed_at":"2017-01-13T09:30:08Z","git_url":"git://github.com/lylogi/sample_app.git","ssh_url":"git@github.com:lylogi/sample_app.git","clone_url":"https://github.com/lylogi/sample_app.git","svn_url":"https://github.com/lylogi/sample_app","homepage":null,"size":218,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"lylogi:master","ref":"master","sha":"fa9dcf35b379a5434b47b1cbbdfb0eec380f4c87","user":{"login":"lylogi","id":14809063,"avatar_url":"https://avatars.githubusercontent.com/u/14809063?v=3","gravatar_id":"","url":"https://api.github.com/users/lylogi","html_url":"https://github.com/lylogi","followers_url":"https://api.github.com/users/lylogi/followers","following_url":"https://api.github.com/users/lylogi/following{/other_user}","gists_url":"https://api.github.com/users/lylogi/gists{/gist_id}","starred_url":"https://api.github.com/users/lylogi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lylogi/subscriptions","organizations_url":"https://api.github.com/users/lylogi/orgs","repos_url":"https://api.github.com/users/lylogi/repos","events_url":"https://api.github.com/users/lylogi/events{/privacy}","received_events_url":"https://api.github.com/users/lylogi/received_events","type":"User","site_admin":false},"repo":{"id":77986495,"name":"sample_app","full_name":"lylogi/sample_app","owner":{"login":"lylogi","id":14809063,"avatar_url":"https://avatars.githubusercontent.com/u/14809063?v=3","gravatar_id":"","url":"https://api.github.com/users/lylogi","html_url":"https://github.com/lylogi","followers_url":"https://api.github.com/users/lylogi/followers","following_url":"https://api.github.com/users/lylogi/following{/other_user}","gists_url":"https://api.github.com/users/lylogi/gists{/gist_id}","starred_url":"https://api.github.com/users/lylogi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lylogi/subscriptions","organizations_url":"https://api.github.com/users/lylogi/orgs","repos_url":"https://api.github.com/users/lylogi/repos","events_url":"https://api.github.com/users/lylogi/events{/privacy}","received_events_url":"https://api.github.com/users/lylogi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lylogi/sample_app","description":null,"fork":false,"url":"https://api.github.com/repos/lylogi/sample_app","forks_url":"https://api.github.com/repos/lylogi/sample_app/forks","keys_url":"https://api.github.com/repos/lylogi/sample_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lylogi/sample_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lylogi/sample_app/teams","hooks_url":"https://api.github.com/repos/lylogi/sample_app/hooks","issue_events_url":"https://api.github.com/repos/lylogi/sample_app/issues/events{/number}","events_url":"https://api.github.com/repos/lylogi/sample_app/events","assignees_url":"https://api.github.com/repos/lylogi/sample_app/assignees{/user}","branches_url":"https://api.github.com/repos/lylogi/sample_app/branches{/branch}","tags_url":"https://api.github.com/repos/lylogi/sample_app/tags","blobs_url":"https://api.github.com/repos/lylogi/sample_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lylogi/sample_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lylogi/sample_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/lylogi/sample_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lylogi/sample_app/statuses/{sha}","languages_url":"https://api.github.com/repos/lylogi/sample_app/languages","stargazers_url":"https://api.github.com/repos/lylogi/sample_app/stargazers","contributors_url":"https://api.github.com/repos/lylogi/sample_app/contributors","subscribers_url":"https://api.github.com/repos/lylogi/sample_app/subscribers","subscription_url":"https://api.github.com/repos/lylogi/sample_app/subscription","commits_url":"https://api.github.com/repos/lylogi/sample_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/lylogi/sample_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/lylogi/sample_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/lylogi/sample_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/lylogi/sample_app/contents/{+path}","compare_url":"https://api.github.com/repos/lylogi/sample_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lylogi/sample_app/merges","archive_url":"https://api.github.com/repos/lylogi/sample_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lylogi/sample_app/downloads","issues_url":"https://api.github.com/repos/lylogi/sample_app/issues{/number}","pulls_url":"https://api.github.com/repos/lylogi/sample_app/pulls{/number}","milestones_url":"https://api.github.com/repos/lylogi/sample_app/milestones{/number}","notifications_url":"https://api.github.com/repos/lylogi/sample_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lylogi/sample_app/labels{/name}","releases_url":"https://api.github.com/repos/lylogi/sample_app/releases{/id}","deployments_url":"https://api.github.com/repos/lylogi/sample_app/deployments","created_at":"2017-01-04T06:07:18Z","updated_at":"2017-01-04T06:08:33Z","pushed_at":"2017-01-13T09:30:08Z","git_url":"git://github.com/lylogi/sample_app.git","ssh_url":"git@github.com:lylogi/sample_app.git","clone_url":"https://github.com/lylogi/sample_app.git","svn_url":"https://github.com/lylogi/sample_app","homepage":null,"size":218,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lylogi/sample_app/pulls/11"},"html":{"href":"https://github.com/lylogi/sample_app/pull/11"},"issue":{"href":"https://api.github.com/repos/lylogi/sample_app/issues/11"},"comments":{"href":"https://api.github.com/repos/lylogi/sample_app/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/lylogi/sample_app/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/lylogi/sample_app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lylogi/sample_app/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/lylogi/sample_app/statuses/689318b5ac76c75bca6de5311d6893c663107764"}}}}
{"actor":{"display_login":"sangnuce"}}