{"action":"created","comment":{"url":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls/comments/83592875","pull_request_review_id":4426015,"id":83592875,"diff_hunk":"@@ -9,4 +10,28 @@ class User < ApplicationRecord\n \n   has_secure_password\n   validates :password, presence: true, length: {minimum: 6}\n+\n+  def User.digest string\n+    cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST :\n+      BCrypt::Engine.cost\n+    BCrypt::Password.create string, cost: cost\n+  end\n+\n+  def User.new_token\n+    SecureRandom.urlsafe_base64\n+  end\n+\n+  def remember\n+    self.remember_token = User.new_token\n+    update_attribute :remember_digest, User.digest(remember_token)","path":"app/models/user.rb","position":24,"original_position":24,"commit_id":"27f68e206fa992e6f01c0db509de40db1c8582a5","original_commit_id":"27f68e206fa992e6f01c0db509de40db1c8582a5","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":"sử dụng update_attributes nhé, tìm cách sử dụng nhé. mình k dùng update_attribute đâu","created_at":"2016-10-17T08:05:30Z","updated_at":"2016-10-17T08:05:35Z","html_url":"https://github.com/kevtran410/rails_tutorial/pull/7#discussion_r83592875","pull_request_url":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls/comments/83592875"},"html":{"href":"https://github.com/kevtran410/rails_tutorial/pull/7#discussion_r83592875"},"pull_request":{"href":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls/7","id":89576913,"html_url":"https://github.com/kevtran410/rails_tutorial/pull/7","diff_url":"https://github.com/kevtran410/rails_tutorial/pull/7.diff","patch_url":"https://github.com/kevtran410/rails_tutorial/pull/7.patch","issue_url":"https://api.github.com/repos/kevtran410/rails_tutorial/issues/7","number":7,"state":"open","locked":false,"title":"advanced-login","user":{"login":"kevtran410","id":22665728,"avatar_url":"https://avatars.githubusercontent.com/u/22665728?v=3","gravatar_id":"","url":"https://api.github.com/users/kevtran410","html_url":"https://github.com/kevtran410","followers_url":"https://api.github.com/users/kevtran410/followers","following_url":"https://api.github.com/users/kevtran410/following{/other_user}","gists_url":"https://api.github.com/users/kevtran410/gists{/gist_id}","starred_url":"https://api.github.com/users/kevtran410/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevtran410/subscriptions","organizations_url":"https://api.github.com/users/kevtran410/orgs","repos_url":"https://api.github.com/users/kevtran410/repos","events_url":"https://api.github.com/users/kevtran410/events{/privacy}","received_events_url":"https://api.github.com/users/kevtran410/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-17T08:03:26Z","updated_at":"2016-10-17T08:05:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ae3b4e18ef778d218439cc7624f86a126fb5883","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls/7/commits","review_comments_url":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls/7/comments","review_comment_url":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kevtran410/rails_tutorial/issues/7/comments","statuses_url":"https://api.github.com/repos/kevtran410/rails_tutorial/statuses/27f68e206fa992e6f01c0db509de40db1c8582a5","head":{"label":"kevtran410:advanced-login","ref":"advanced-login","sha":"27f68e206fa992e6f01c0db509de40db1c8582a5","user":{"login":"kevtran410","id":22665728,"avatar_url":"https://avatars.githubusercontent.com/u/22665728?v=3","gravatar_id":"","url":"https://api.github.com/users/kevtran410","html_url":"https://github.com/kevtran410","followers_url":"https://api.github.com/users/kevtran410/followers","following_url":"https://api.github.com/users/kevtran410/following{/other_user}","gists_url":"https://api.github.com/users/kevtran410/gists{/gist_id}","starred_url":"https://api.github.com/users/kevtran410/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevtran410/subscriptions","organizations_url":"https://api.github.com/users/kevtran410/orgs","repos_url":"https://api.github.com/users/kevtran410/repos","events_url":"https://api.github.com/users/kevtran410/events{/privacy}","received_events_url":"https://api.github.com/users/kevtran410/received_events","type":"User","site_admin":false},"repo":{"id":70456904,"name":"rails_tutorial","full_name":"kevtran410/rails_tutorial","owner":{"login":"kevtran410","id":22665728,"avatar_url":"https://avatars.githubusercontent.com/u/22665728?v=3","gravatar_id":"","url":"https://api.github.com/users/kevtran410","html_url":"https://github.com/kevtran410","followers_url":"https://api.github.com/users/kevtran410/followers","following_url":"https://api.github.com/users/kevtran410/following{/other_user}","gists_url":"https://api.github.com/users/kevtran410/gists{/gist_id}","starred_url":"https://api.github.com/users/kevtran410/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevtran410/subscriptions","organizations_url":"https://api.github.com/users/kevtran410/orgs","repos_url":"https://api.github.com/users/kevtran410/repos","events_url":"https://api.github.com/users/kevtran410/events{/privacy}","received_events_url":"https://api.github.com/users/kevtran410/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kevtran410/rails_tutorial","description":null,"fork":false,"url":"https://api.github.com/repos/kevtran410/rails_tutorial","forks_url":"https://api.github.com/repos/kevtran410/rails_tutorial/forks","keys_url":"https://api.github.com/repos/kevtran410/rails_tutorial/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kevtran410/rails_tutorial/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kevtran410/rails_tutorial/teams","hooks_url":"https://api.github.com/repos/kevtran410/rails_tutorial/hooks","issue_events_url":"https://api.github.com/repos/kevtran410/rails_tutorial/issues/events{/number}","events_url":"https://api.github.com/repos/kevtran410/rails_tutorial/events","assignees_url":"https://api.github.com/repos/kevtran410/rails_tutorial/assignees{/user}","branches_url":"https://api.github.com/repos/kevtran410/rails_tutorial/branches{/branch}","tags_url":"https://api.github.com/repos/kevtran410/rails_tutorial/tags","blobs_url":"https://api.github.com/repos/kevtran410/rails_tutorial/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kevtran410/rails_tutorial/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kevtran410/rails_tutorial/git/refs{/sha}","trees_url":"https://api.github.com/repos/kevtran410/rails_tutorial/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kevtran410/rails_tutorial/statuses/{sha}","languages_url":"https://api.github.com/repos/kevtran410/rails_tutorial/languages","stargazers_url":"https://api.github.com/repos/kevtran410/rails_tutorial/stargazers","contributors_url":"https://api.github.com/repos/kevtran410/rails_tutorial/contributors","subscribers_url":"https://api.github.com/repos/kevtran410/rails_tutorial/subscribers","subscription_url":"https://api.github.com/repos/kevtran410/rails_tutorial/subscription","commits_url":"https://api.github.com/repos/kevtran410/rails_tutorial/commits{/sha}","git_commits_url":"https://api.github.com/repos/kevtran410/rails_tutorial/git/commits{/sha}","comments_url":"https://api.github.com/repos/kevtran410/rails_tutorial/comments{/number}","issue_comment_url":"https://api.github.com/repos/kevtran410/rails_tutorial/issues/comments{/number}","contents_url":"https://api.github.com/repos/kevtran410/rails_tutorial/contents/{+path}","compare_url":"https://api.github.com/repos/kevtran410/rails_tutorial/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kevtran410/rails_tutorial/merges","archive_url":"https://api.github.com/repos/kevtran410/rails_tutorial/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kevtran410/rails_tutorial/downloads","issues_url":"https://api.github.com/repos/kevtran410/rails_tutorial/issues{/number}","pulls_url":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls{/number}","milestones_url":"https://api.github.com/repos/kevtran410/rails_tutorial/milestones{/number}","notifications_url":"https://api.github.com/repos/kevtran410/rails_tutorial/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kevtran410/rails_tutorial/labels{/name}","releases_url":"https://api.github.com/repos/kevtran410/rails_tutorial/releases{/id}","deployments_url":"https://api.github.com/repos/kevtran410/rails_tutorial/deployments","created_at":"2016-10-10T06:06:39Z","updated_at":"2016-10-10T06:08:27Z","pushed_at":"2016-10-17T08:03:26Z","git_url":"git://github.com/kevtran410/rails_tutorial.git","ssh_url":"git@github.com:kevtran410/rails_tutorial.git","clone_url":"https://github.com/kevtran410/rails_tutorial.git","svn_url":"https://github.com/kevtran410/rails_tutorial","homepage":null,"size":49,"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":"kevtran410:master","ref":"master","sha":"6792dc4fed156bfcb7ca2835ed1623f18da1652f","user":{"login":"kevtran410","id":22665728,"avatar_url":"https://avatars.githubusercontent.com/u/22665728?v=3","gravatar_id":"","url":"https://api.github.com/users/kevtran410","html_url":"https://github.com/kevtran410","followers_url":"https://api.github.com/users/kevtran410/followers","following_url":"https://api.github.com/users/kevtran410/following{/other_user}","gists_url":"https://api.github.com/users/kevtran410/gists{/gist_id}","starred_url":"https://api.github.com/users/kevtran410/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevtran410/subscriptions","organizations_url":"https://api.github.com/users/kevtran410/orgs","repos_url":"https://api.github.com/users/kevtran410/repos","events_url":"https://api.github.com/users/kevtran410/events{/privacy}","received_events_url":"https://api.github.com/users/kevtran410/received_events","type":"User","site_admin":false},"repo":{"id":70456904,"name":"rails_tutorial","full_name":"kevtran410/rails_tutorial","owner":{"login":"kevtran410","id":22665728,"avatar_url":"https://avatars.githubusercontent.com/u/22665728?v=3","gravatar_id":"","url":"https://api.github.com/users/kevtran410","html_url":"https://github.com/kevtran410","followers_url":"https://api.github.com/users/kevtran410/followers","following_url":"https://api.github.com/users/kevtran410/following{/other_user}","gists_url":"https://api.github.com/users/kevtran410/gists{/gist_id}","starred_url":"https://api.github.com/users/kevtran410/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevtran410/subscriptions","organizations_url":"https://api.github.com/users/kevtran410/orgs","repos_url":"https://api.github.com/users/kevtran410/repos","events_url":"https://api.github.com/users/kevtran410/events{/privacy}","received_events_url":"https://api.github.com/users/kevtran410/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kevtran410/rails_tutorial","description":null,"fork":false,"url":"https://api.github.com/repos/kevtran410/rails_tutorial","forks_url":"https://api.github.com/repos/kevtran410/rails_tutorial/forks","keys_url":"https://api.github.com/repos/kevtran410/rails_tutorial/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kevtran410/rails_tutorial/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kevtran410/rails_tutorial/teams","hooks_url":"https://api.github.com/repos/kevtran410/rails_tutorial/hooks","issue_events_url":"https://api.github.com/repos/kevtran410/rails_tutorial/issues/events{/number}","events_url":"https://api.github.com/repos/kevtran410/rails_tutorial/events","assignees_url":"https://api.github.com/repos/kevtran410/rails_tutorial/assignees{/user}","branches_url":"https://api.github.com/repos/kevtran410/rails_tutorial/branches{/branch}","tags_url":"https://api.github.com/repos/kevtran410/rails_tutorial/tags","blobs_url":"https://api.github.com/repos/kevtran410/rails_tutorial/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kevtran410/rails_tutorial/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kevtran410/rails_tutorial/git/refs{/sha}","trees_url":"https://api.github.com/repos/kevtran410/rails_tutorial/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kevtran410/rails_tutorial/statuses/{sha}","languages_url":"https://api.github.com/repos/kevtran410/rails_tutorial/languages","stargazers_url":"https://api.github.com/repos/kevtran410/rails_tutorial/stargazers","contributors_url":"https://api.github.com/repos/kevtran410/rails_tutorial/contributors","subscribers_url":"https://api.github.com/repos/kevtran410/rails_tutorial/subscribers","subscription_url":"https://api.github.com/repos/kevtran410/rails_tutorial/subscription","commits_url":"https://api.github.com/repos/kevtran410/rails_tutorial/commits{/sha}","git_commits_url":"https://api.github.com/repos/kevtran410/rails_tutorial/git/commits{/sha}","comments_url":"https://api.github.com/repos/kevtran410/rails_tutorial/comments{/number}","issue_comment_url":"https://api.github.com/repos/kevtran410/rails_tutorial/issues/comments{/number}","contents_url":"https://api.github.com/repos/kevtran410/rails_tutorial/contents/{+path}","compare_url":"https://api.github.com/repos/kevtran410/rails_tutorial/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kevtran410/rails_tutorial/merges","archive_url":"https://api.github.com/repos/kevtran410/rails_tutorial/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kevtran410/rails_tutorial/downloads","issues_url":"https://api.github.com/repos/kevtran410/rails_tutorial/issues{/number}","pulls_url":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls{/number}","milestones_url":"https://api.github.com/repos/kevtran410/rails_tutorial/milestones{/number}","notifications_url":"https://api.github.com/repos/kevtran410/rails_tutorial/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kevtran410/rails_tutorial/labels{/name}","releases_url":"https://api.github.com/repos/kevtran410/rails_tutorial/releases{/id}","deployments_url":"https://api.github.com/repos/kevtran410/rails_tutorial/deployments","created_at":"2016-10-10T06:06:39Z","updated_at":"2016-10-10T06:08:27Z","pushed_at":"2016-10-17T08:03:26Z","git_url":"git://github.com/kevtran410/rails_tutorial.git","ssh_url":"git@github.com:kevtran410/rails_tutorial.git","clone_url":"https://github.com/kevtran410/rails_tutorial.git","svn_url":"https://github.com/kevtran410/rails_tutorial","homepage":null,"size":49,"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/kevtran410/rails_tutorial/pulls/7"},"html":{"href":"https://github.com/kevtran410/rails_tutorial/pull/7"},"issue":{"href":"https://api.github.com/repos/kevtran410/rails_tutorial/issues/7"},"comments":{"href":"https://api.github.com/repos/kevtran410/rails_tutorial/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kevtran410/rails_tutorial/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/kevtran410/rails_tutorial/statuses/27f68e206fa992e6f01c0db509de40db1c8582a5"}}}}
{"actor":{"display_login":"hellovietnam93"}}