{"action":"created","comment":{"url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls/comments/222865161","pull_request_review_id":161857220,"id":222865161,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMjg2NTE2MQ==","diff_hunk":"@@ -26,12 +23,33 @@ def remember\n     update remember_digest: User.digest(remember_token)\n   end\n \n-  def authenticated? remember_token\n-    return false if remember_digest.nil?\n-    BCrypt::Password.new(remember_digest).is_password? remember_token\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 remember_digest: nil\n   end\n+\n+  def activate\n+    update_attribute :activated, true\n+    update_attribute :activated_at, Time.zone.now\n+  end\n+\n+  def send_activation_email\n+    UserMailer.account_activation(self).deliver_now\n+  end\n+\n+  private\n+\n+  def downcase_email\n+    self.email = email.downcase","path":"app/models/user.rb","position":50,"original_position":50,"commit_id":"1b70f34e87ade2272d60c65aae79eae417dfb7cb","original_commit_id":"1b70f34e87ade2272d60c65aae79eae417dfb7cb","user":{"login":"huongnguyenmta","id":18224922,"node_id":"MDQ6VXNlcjE4MjI0OTIy","avatar_url":"https://avatars3.githubusercontent.com/u/18224922?v=4","gravatar_id":"","url":"https://api.github.com/users/huongnguyenmta","html_url":"https://github.com/huongnguyenmta","followers_url":"https://api.github.com/users/huongnguyenmta/followers","following_url":"https://api.github.com/users/huongnguyenmta/following{/other_user}","gists_url":"https://api.github.com/users/huongnguyenmta/gists{/gist_id}","starred_url":"https://api.github.com/users/huongnguyenmta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huongnguyenmta/subscriptions","organizations_url":"https://api.github.com/users/huongnguyenmta/orgs","repos_url":"https://api.github.com/users/huongnguyenmta/repos","events_url":"https://api.github.com/users/huongnguyenmta/events{/privacy}","received_events_url":"https://api.github.com/users/huongnguyenmta/received_events","type":"User","site_admin":false},"body":"` self.email = email.downcase` => `email.downcase!`","created_at":"2018-10-05T00:30:50Z","updated_at":"2018-10-05T00:31:44Z","html_url":"https://github.com/NguyenDangVan/rubyonrailstutorial/pull/9#discussion_r222865161","pull_request_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls/9","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls/comments/222865161"},"html":{"href":"https://github.com/NguyenDangVan/rubyonrailstutorial/pull/9#discussion_r222865161"},"pull_request":{"href":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls/9","id":220400922,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNDAwOTIy","html_url":"https://github.com/NguyenDangVan/rubyonrailstutorial/pull/9","diff_url":"https://github.com/NguyenDangVan/rubyonrailstutorial/pull/9.diff","patch_url":"https://github.com/NguyenDangVan/rubyonrailstutorial/pull/9.patch","issue_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/issues/9","number":9,"state":"open","locked":false,"title":"account-activation","user":{"login":"NguyenDangVan","id":43035106,"node_id":"MDQ6VXNlcjQzMDM1MTA2","avatar_url":"https://avatars3.githubusercontent.com/u/43035106?v=4","gravatar_id":"","url":"https://api.github.com/users/NguyenDangVan","html_url":"https://github.com/NguyenDangVan","followers_url":"https://api.github.com/users/NguyenDangVan/followers","following_url":"https://api.github.com/users/NguyenDangVan/following{/other_user}","gists_url":"https://api.github.com/users/NguyenDangVan/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenDangVan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenDangVan/subscriptions","organizations_url":"https://api.github.com/users/NguyenDangVan/orgs","repos_url":"https://api.github.com/users/NguyenDangVan/repos","events_url":"https://api.github.com/users/NguyenDangVan/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenDangVan/received_events","type":"User","site_admin":false},"body":"send email to active account","created_at":"2018-10-04T14:33:50Z","updated_at":"2018-10-05T00:31:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ace1970f08deba1f321d7be17afb44df2edd2f1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls/9/commits","review_comments_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls/9/comments","review_comment_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/issues/9/comments","statuses_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/statuses/1b70f34e87ade2272d60c65aae79eae417dfb7cb","head":{"label":"NguyenDangVan:account-activation","ref":"account-activation","sha":"1b70f34e87ade2272d60c65aae79eae417dfb7cb","user":{"login":"NguyenDangVan","id":43035106,"node_id":"MDQ6VXNlcjQzMDM1MTA2","avatar_url":"https://avatars3.githubusercontent.com/u/43035106?v=4","gravatar_id":"","url":"https://api.github.com/users/NguyenDangVan","html_url":"https://github.com/NguyenDangVan","followers_url":"https://api.github.com/users/NguyenDangVan/followers","following_url":"https://api.github.com/users/NguyenDangVan/following{/other_user}","gists_url":"https://api.github.com/users/NguyenDangVan/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenDangVan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenDangVan/subscriptions","organizations_url":"https://api.github.com/users/NguyenDangVan/orgs","repos_url":"https://api.github.com/users/NguyenDangVan/repos","events_url":"https://api.github.com/users/NguyenDangVan/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenDangVan/received_events","type":"User","site_admin":false},"repo":{"id":150685001,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA2ODUwMDE=","name":"rubyonrailstutorial","full_name":"NguyenDangVan/rubyonrailstutorial","private":false,"owner":{"login":"NguyenDangVan","id":43035106,"node_id":"MDQ6VXNlcjQzMDM1MTA2","avatar_url":"https://avatars3.githubusercontent.com/u/43035106?v=4","gravatar_id":"","url":"https://api.github.com/users/NguyenDangVan","html_url":"https://github.com/NguyenDangVan","followers_url":"https://api.github.com/users/NguyenDangVan/followers","following_url":"https://api.github.com/users/NguyenDangVan/following{/other_user}","gists_url":"https://api.github.com/users/NguyenDangVan/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenDangVan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenDangVan/subscriptions","organizations_url":"https://api.github.com/users/NguyenDangVan/orgs","repos_url":"https://api.github.com/users/NguyenDangVan/repos","events_url":"https://api.github.com/users/NguyenDangVan/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenDangVan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/NguyenDangVan/rubyonrailstutorial","description":null,"fork":false,"url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial","forks_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/forks","keys_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/teams","hooks_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/hooks","issue_events_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/issues/events{/number}","events_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/events","assignees_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/assignees{/user}","branches_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/branches{/branch}","tags_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/tags","blobs_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/git/refs{/sha}","trees_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/statuses/{sha}","languages_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/languages","stargazers_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/stargazers","contributors_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/contributors","subscribers_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/subscribers","subscription_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/subscription","commits_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/commits{/sha}","git_commits_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/git/commits{/sha}","comments_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/comments{/number}","issue_comment_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/issues/comments{/number}","contents_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/contents/{+path}","compare_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/merges","archive_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/downloads","issues_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/issues{/number}","pulls_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls{/number}","milestones_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/milestones{/number}","notifications_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/labels{/name}","releases_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/releases{/id}","deployments_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/deployments","created_at":"2018-09-28T04:17:08Z","updated_at":"2018-10-04T04:15:31Z","pushed_at":"2018-10-04T16:54:08Z","git_url":"git://github.com/NguyenDangVan/rubyonrailstutorial.git","ssh_url":"git@github.com:NguyenDangVan/rubyonrailstutorial.git","clone_url":"https://github.com/NguyenDangVan/rubyonrailstutorial.git","svn_url":"https://github.com/NguyenDangVan/rubyonrailstutorial","homepage":null,"size":65,"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":"NguyenDangVan:master","ref":"master","sha":"c86dd22d505cee6dda1659386a7fe703f6bc6ce1","user":{"login":"NguyenDangVan","id":43035106,"node_id":"MDQ6VXNlcjQzMDM1MTA2","avatar_url":"https://avatars3.githubusercontent.com/u/43035106?v=4","gravatar_id":"","url":"https://api.github.com/users/NguyenDangVan","html_url":"https://github.com/NguyenDangVan","followers_url":"https://api.github.com/users/NguyenDangVan/followers","following_url":"https://api.github.com/users/NguyenDangVan/following{/other_user}","gists_url":"https://api.github.com/users/NguyenDangVan/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenDangVan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenDangVan/subscriptions","organizations_url":"https://api.github.com/users/NguyenDangVan/orgs","repos_url":"https://api.github.com/users/NguyenDangVan/repos","events_url":"https://api.github.com/users/NguyenDangVan/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenDangVan/received_events","type":"User","site_admin":false},"repo":{"id":150685001,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA2ODUwMDE=","name":"rubyonrailstutorial","full_name":"NguyenDangVan/rubyonrailstutorial","private":false,"owner":{"login":"NguyenDangVan","id":43035106,"node_id":"MDQ6VXNlcjQzMDM1MTA2","avatar_url":"https://avatars3.githubusercontent.com/u/43035106?v=4","gravatar_id":"","url":"https://api.github.com/users/NguyenDangVan","html_url":"https://github.com/NguyenDangVan","followers_url":"https://api.github.com/users/NguyenDangVan/followers","following_url":"https://api.github.com/users/NguyenDangVan/following{/other_user}","gists_url":"https://api.github.com/users/NguyenDangVan/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenDangVan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenDangVan/subscriptions","organizations_url":"https://api.github.com/users/NguyenDangVan/orgs","repos_url":"https://api.github.com/users/NguyenDangVan/repos","events_url":"https://api.github.com/users/NguyenDangVan/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenDangVan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/NguyenDangVan/rubyonrailstutorial","description":null,"fork":false,"url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial","forks_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/forks","keys_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/teams","hooks_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/hooks","issue_events_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/issues/events{/number}","events_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/events","assignees_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/assignees{/user}","branches_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/branches{/branch}","tags_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/tags","blobs_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/git/refs{/sha}","trees_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/statuses/{sha}","languages_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/languages","stargazers_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/stargazers","contributors_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/contributors","subscribers_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/subscribers","subscription_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/subscription","commits_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/commits{/sha}","git_commits_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/git/commits{/sha}","comments_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/comments{/number}","issue_comment_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/issues/comments{/number}","contents_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/contents/{+path}","compare_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/merges","archive_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/downloads","issues_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/issues{/number}","pulls_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls{/number}","milestones_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/milestones{/number}","notifications_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/labels{/name}","releases_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/releases{/id}","deployments_url":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/deployments","created_at":"2018-09-28T04:17:08Z","updated_at":"2018-10-04T04:15:31Z","pushed_at":"2018-10-04T16:54:08Z","git_url":"git://github.com/NguyenDangVan/rubyonrailstutorial.git","ssh_url":"git@github.com:NguyenDangVan/rubyonrailstutorial.git","clone_url":"https://github.com/NguyenDangVan/rubyonrailstutorial.git","svn_url":"https://github.com/NguyenDangVan/rubyonrailstutorial","homepage":null,"size":65,"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/NguyenDangVan/rubyonrailstutorial/pulls/9"},"html":{"href":"https://github.com/NguyenDangVan/rubyonrailstutorial/pull/9"},"issue":{"href":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/issues/9"},"comments":{"href":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/NguyenDangVan/rubyonrailstutorial/statuses/1b70f34e87ade2272d60c65aae79eae417dfb7cb"}},"author_association":"OWNER"}}
{"actor":{"display_login":"huongnguyenmta"}}