{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/brs_37/pulls/comments/81717919","pull_request_review_id":2676523,"id":81717919,"diff_hunk":"@@ -20,8 +22,38 @@ class User < ApplicationRecord\n   has_secure_password\n   validates :password, presence: true, length: {minimum: 6}, allow_nil: true\n \n-  private\n+  class << self\n+    def 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 new_token\n+      SecureRandom.urlsafe_base64\n+    end\n+  end\n+\n+  def remember\n+    self.remember_token = User.new_token\n+    update_attributes remember_digest: User.digest(remember_token)\n+  end\n+\n+  def authenticated? attribute, token\n+    digest = send(\"#{attribute}_digest\")\n+    return false if digest.nil?\n+    BCrypt::Password.new(digest).is_password?(token)\n+  end\n+\n+  def forget\n+    update_attributes remember_digest: nil\n+  end\n+\n   def downcase_email","path":"app/models/user.rb","position":41,"original_position":41,"commit_id":"327ccbee9b00524890703233edb6ae2a060b02f8","original_commit_id":"b4c880e2fecfb43539f941cf9109a1cd4198e3fb","user":{"login":"nvtanh","id":5591946,"avatar_url":"https://avatars.githubusercontent.com/u/5591946?v=3","gravatar_id":"","url":"https://api.github.com/users/nvtanh","html_url":"https://github.com/nvtanh","followers_url":"https://api.github.com/users/nvtanh/followers","following_url":"https://api.github.com/users/nvtanh/following{/other_user}","gists_url":"https://api.github.com/users/nvtanh/gists{/gist_id}","starred_url":"https://api.github.com/users/nvtanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvtanh/subscriptions","organizations_url":"https://api.github.com/users/nvtanh/orgs","repos_url":"https://api.github.com/users/nvtanh/repos","events_url":"https://api.github.com/users/nvtanh/events{/privacy}","received_events_url":"https://api.github.com/users/nvtanh/received_events","type":"User","site_admin":false},"body":"chỉ a chỗ gọi hàm này? copy vào đây cũng dc","created_at":"2016-10-04T09:27:32Z","updated_at":"2016-10-04T09:27:32Z","html_url":"https://github.com/framgia/brs_37/pull/15#discussion_r81717919","pull_request_url":"https://api.github.com/repos/framgia/brs_37/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/framgia/brs_37/pulls/comments/81717919"},"html":{"href":"https://github.com/framgia/brs_37/pull/15#discussion_r81717919"},"pull_request":{"href":"https://api.github.com/repos/framgia/brs_37/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/brs_37/pulls/15","id":87693843,"html_url":"https://github.com/framgia/brs_37/pull/15","diff_url":"https://github.com/framgia/brs_37/pull/15.diff","patch_url":"https://github.com/framgia/brs_37/pull/15.patch","issue_url":"https://api.github.com/repos/framgia/brs_37/issues/15","number":15,"state":"open","locked":false,"title":"user login-logout","user":{"login":"quynhqtvn","id":20477357,"avatar_url":"https://avatars.githubusercontent.com/u/20477357?v=3","gravatar_id":"","url":"https://api.github.com/users/quynhqtvn","html_url":"https://github.com/quynhqtvn","followers_url":"https://api.github.com/users/quynhqtvn/followers","following_url":"https://api.github.com/users/quynhqtvn/following{/other_user}","gists_url":"https://api.github.com/users/quynhqtvn/gists{/gist_id}","starred_url":"https://api.github.com/users/quynhqtvn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quynhqtvn/subscriptions","organizations_url":"https://api.github.com/users/quynhqtvn/orgs","repos_url":"https://api.github.com/users/quynhqtvn/repos","events_url":"https://api.github.com/users/quynhqtvn/events{/privacy}","received_events_url":"https://api.github.com/users/quynhqtvn/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-03T10:29:27Z","updated_at":"2016-10-04T09:27:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"777064c1904c81155fa32a0e83fda04ca5d3f7ac","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/brs_37/pulls/15/commits","review_comments_url":"https://api.github.com/repos/framgia/brs_37/pulls/15/comments","review_comment_url":"https://api.github.com/repos/framgia/brs_37/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/brs_37/issues/15/comments","statuses_url":"https://api.github.com/repos/framgia/brs_37/statuses/327ccbee9b00524890703233edb6ae2a060b02f8","head":{"label":"quynhqtvn:user-signup","ref":"user-signup","sha":"327ccbee9b00524890703233edb6ae2a060b02f8","user":{"login":"quynhqtvn","id":20477357,"avatar_url":"https://avatars.githubusercontent.com/u/20477357?v=3","gravatar_id":"","url":"https://api.github.com/users/quynhqtvn","html_url":"https://github.com/quynhqtvn","followers_url":"https://api.github.com/users/quynhqtvn/followers","following_url":"https://api.github.com/users/quynhqtvn/following{/other_user}","gists_url":"https://api.github.com/users/quynhqtvn/gists{/gist_id}","starred_url":"https://api.github.com/users/quynhqtvn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quynhqtvn/subscriptions","organizations_url":"https://api.github.com/users/quynhqtvn/orgs","repos_url":"https://api.github.com/users/quynhqtvn/repos","events_url":"https://api.github.com/users/quynhqtvn/events{/privacy}","received_events_url":"https://api.github.com/users/quynhqtvn/received_events","type":"User","site_admin":false},"repo":{"id":69746025,"name":"brs_37","full_name":"quynhqtvn/brs_37","owner":{"login":"quynhqtvn","id":20477357,"avatar_url":"https://avatars.githubusercontent.com/u/20477357?v=3","gravatar_id":"","url":"https://api.github.com/users/quynhqtvn","html_url":"https://github.com/quynhqtvn","followers_url":"https://api.github.com/users/quynhqtvn/followers","following_url":"https://api.github.com/users/quynhqtvn/following{/other_user}","gists_url":"https://api.github.com/users/quynhqtvn/gists{/gist_id}","starred_url":"https://api.github.com/users/quynhqtvn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quynhqtvn/subscriptions","organizations_url":"https://api.github.com/users/quynhqtvn/orgs","repos_url":"https://api.github.com/users/quynhqtvn/repos","events_url":"https://api.github.com/users/quynhqtvn/events{/privacy}","received_events_url":"https://api.github.com/users/quynhqtvn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/quynhqtvn/brs_37","description":"Framgia Book Reviewing System (training)","fork":true,"url":"https://api.github.com/repos/quynhqtvn/brs_37","forks_url":"https://api.github.com/repos/quynhqtvn/brs_37/forks","keys_url":"https://api.github.com/repos/quynhqtvn/brs_37/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quynhqtvn/brs_37/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quynhqtvn/brs_37/teams","hooks_url":"https://api.github.com/repos/quynhqtvn/brs_37/hooks","issue_events_url":"https://api.github.com/repos/quynhqtvn/brs_37/issues/events{/number}","events_url":"https://api.github.com/repos/quynhqtvn/brs_37/events","assignees_url":"https://api.github.com/repos/quynhqtvn/brs_37/assignees{/user}","branches_url":"https://api.github.com/repos/quynhqtvn/brs_37/branches{/branch}","tags_url":"https://api.github.com/repos/quynhqtvn/brs_37/tags","blobs_url":"https://api.github.com/repos/quynhqtvn/brs_37/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quynhqtvn/brs_37/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quynhqtvn/brs_37/git/refs{/sha}","trees_url":"https://api.github.com/repos/quynhqtvn/brs_37/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quynhqtvn/brs_37/statuses/{sha}","languages_url":"https://api.github.com/repos/quynhqtvn/brs_37/languages","stargazers_url":"https://api.github.com/repos/quynhqtvn/brs_37/stargazers","contributors_url":"https://api.github.com/repos/quynhqtvn/brs_37/contributors","subscribers_url":"https://api.github.com/repos/quynhqtvn/brs_37/subscribers","subscription_url":"https://api.github.com/repos/quynhqtvn/brs_37/subscription","commits_url":"https://api.github.com/repos/quynhqtvn/brs_37/commits{/sha}","git_commits_url":"https://api.github.com/repos/quynhqtvn/brs_37/git/commits{/sha}","comments_url":"https://api.github.com/repos/quynhqtvn/brs_37/comments{/number}","issue_comment_url":"https://api.github.com/repos/quynhqtvn/brs_37/issues/comments{/number}","contents_url":"https://api.github.com/repos/quynhqtvn/brs_37/contents/{+path}","compare_url":"https://api.github.com/repos/quynhqtvn/brs_37/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quynhqtvn/brs_37/merges","archive_url":"https://api.github.com/repos/quynhqtvn/brs_37/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quynhqtvn/brs_37/downloads","issues_url":"https://api.github.com/repos/quynhqtvn/brs_37/issues{/number}","pulls_url":"https://api.github.com/repos/quynhqtvn/brs_37/pulls{/number}","milestones_url":"https://api.github.com/repos/quynhqtvn/brs_37/milestones{/number}","notifications_url":"https://api.github.com/repos/quynhqtvn/brs_37/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quynhqtvn/brs_37/labels{/name}","releases_url":"https://api.github.com/repos/quynhqtvn/brs_37/releases{/id}","deployments_url":"https://api.github.com/repos/quynhqtvn/brs_37/deployments","created_at":"2016-10-01T15:19:25Z","updated_at":"2016-09-27T09:09:34Z","pushed_at":"2016-10-04T08:59:37Z","git_url":"git://github.com/quynhqtvn/brs_37.git","ssh_url":"git@github.com:quynhqtvn/brs_37.git","clone_url":"https://github.com/quynhqtvn/brs_37.git","svn_url":"https://github.com/quynhqtvn/brs_37","homepage":null,"size":45,"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":"450d6ee4127d3a2d79bb9a144cf647ee72b01a00","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":69339061,"name":"brs_37","full_name":"framgia/brs_37","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/brs_37","description":"Framgia Book Reviewing System (training)","fork":false,"url":"https://api.github.com/repos/framgia/brs_37","forks_url":"https://api.github.com/repos/framgia/brs_37/forks","keys_url":"https://api.github.com/repos/framgia/brs_37/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/brs_37/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/brs_37/teams","hooks_url":"https://api.github.com/repos/framgia/brs_37/hooks","issue_events_url":"https://api.github.com/repos/framgia/brs_37/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/brs_37/events","assignees_url":"https://api.github.com/repos/framgia/brs_37/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/brs_37/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/brs_37/tags","blobs_url":"https://api.github.com/repos/framgia/brs_37/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/brs_37/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/brs_37/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/brs_37/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/brs_37/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/brs_37/languages","stargazers_url":"https://api.github.com/repos/framgia/brs_37/stargazers","contributors_url":"https://api.github.com/repos/framgia/brs_37/contributors","subscribers_url":"https://api.github.com/repos/framgia/brs_37/subscribers","subscription_url":"https://api.github.com/repos/framgia/brs_37/subscription","commits_url":"https://api.github.com/repos/framgia/brs_37/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/brs_37/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/brs_37/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/brs_37/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/brs_37/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/brs_37/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/brs_37/merges","archive_url":"https://api.github.com/repos/framgia/brs_37/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/brs_37/downloads","issues_url":"https://api.github.com/repos/framgia/brs_37/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/brs_37/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/brs_37/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/brs_37/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/brs_37/labels{/name}","releases_url":"https://api.github.com/repos/framgia/brs_37/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/brs_37/deployments","created_at":"2016-09-27T09:09:34Z","updated_at":"2016-09-27T09:09:34Z","pushed_at":"2016-10-04T08:59:37Z","git_url":"git://github.com/framgia/brs_37.git","ssh_url":"git@github.com:framgia/brs_37.git","clone_url":"https://github.com/framgia/brs_37.git","svn_url":"https://github.com/framgia/brs_37","homepage":null,"size":85,"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/brs_37/pulls/15"},"html":{"href":"https://github.com/framgia/brs_37/pull/15"},"issue":{"href":"https://api.github.com/repos/framgia/brs_37/issues/15"},"comments":{"href":"https://api.github.com/repos/framgia/brs_37/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/brs_37/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/brs_37/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/brs_37/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/brs_37/statuses/327ccbee9b00524890703233edb6ae2a060b02f8"}}}}
{"actor":{"display_login":"nvtanh"}}