GitHub PullRequestReviewCommentEvent at 2014-07-08 16:18:12
Repository: hnews
Actor: andycandrea
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/andycandrea/hnews/pulls/comments/14662782","id":14662782,"diff_hunk":"@@ -0,0 +1,51 @@\n+class PasswordReset\n+  include ActiveModel::Model\n+\n+  attr_accessor :email, :token, :password, :password_confirmation\n+\n+  def user\n+    @user ||= if email.present?\n+                User.find_by(email: email)\n+              else\n+                User.find_by(password_reset_token: token)\n+              end\n+  end\n+  \n+  def deliver \n+    if user.present?\n+      user.save_password_reset_token(token)\n+      UserMailer.reset_password_email(user).deliver\n+    else\n+      errors.add(:base, 'No user exists with that email.')\n+    end\n+  end\n+\n+  def update_user\n+    user.reload","path":"app/models/password_reset.rb","position":24,"original_position":24,"commit_id":"1eb80010b2898b19f7379cb452c124720a086f70","original_commit_id":"1eb80010b2898b19f7379cb452c124720a086f70","user":{"login":"andycandrea","id":5621517,"avatar_url":"https://avatars.githubusercontent.com/u/5621517?","gravatar_id":"fba559ba333b8173b21fef7fa05142b1","url":"https://api.github.com/users/andycandrea","html_url":"https://github.com/andycandrea","followers_url":"https://api.github.com/users/andycandrea/followers","following_url":"https://api.github.com/users/andycandrea/following{/other_user}","gists_url":"https://api.github.com/users/andycandrea/gists{/gist_id}","starred_url":"https://api.github.com/users/andycandrea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andycandrea/subscriptions","organizations_url":"https://api.github.com/users/andycandrea/orgs","repos_url":"https://api.github.com/users/andycandrea/repos","events_url":"https://api.github.com/users/andycandrea/events{/privacy}","received_events_url":"https://api.github.com/users/andycandrea/received_events","type":"User","site_admin":false},"body":"https://github.com/andycandrea/hnews/blob/1eb80010b2898b19f7379cb452c124720a086f70/spec/models/password_reset_spec.rb#L45","created_at":"2014-07-08T16:18:12Z","updated_at":"2014-07-08T16:18:12Z","html_url":"https://github.com/andycandrea/hnews/pull/21#discussion_r14662782","pull_request_url":"https://api.github.com/repos/andycandrea/hnews/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/andycandrea/hnews/pulls/comments/14662782"},"html":{"href":"https://github.com/andycandrea/hnews/pull/21#discussion_r14662782"},"pull_request":{"href":"https://api.github.com/repos/andycandrea/hnews/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/andycandrea/hnews/pulls/21","id":17909349,"html_url":"https://github.com/andycandrea/hnews/pull/21","diff_url":"https://github.com/andycandrea/hnews/pull/21.diff","patch_url":"https://github.com/andycandrea/hnews/pull/21.patch","issue_url":"https://api.github.com/repos/andycandrea/hnews/issues/21","number":21,"state":"open","title":"Password reset","user":{"login":"andycandrea","id":5621517,"avatar_url":"https://avatars.githubusercontent.com/u/5621517?","gravatar_id":"fba559ba333b8173b21fef7fa05142b1","url":"https://api.github.com/users/andycandrea","html_url":"https://github.com/andycandrea","followers_url":"https://api.github.com/users/andycandrea/followers","following_url":"https://api.github.com/users/andycandrea/following{/other_user}","gists_url":"https://api.github.com/users/andycandrea/gists{/gist_id}","starred_url":"https://api.github.com/users/andycandrea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andycandrea/subscriptions","organizations_url":"https://api.github.com/users/andycandrea/orgs","repos_url":"https://api.github.com/users/andycandrea/repos","events_url":"https://api.github.com/users/andycandrea/events{/privacy}","received_events_url":"https://api.github.com/users/andycandrea/received_events","type":"User","site_admin":false},"body":"Add ability for users to reset their passwords via email. Also allows users to edit their email and passwords within the app. Resolves #13 .","created_at":"2014-07-02T20:15:41Z","updated_at":"2014-07-08T16:18:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0edd45e77fa8dfc1a318839fb61eeb1e05427c8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/andycandrea/hnews/pulls/21/commits","review_comments_url":"https://api.github.com/repos/andycandrea/hnews/pulls/21/comments","review_comment_url":"https://api.github.com/repos/andycandrea/hnews/pulls/comments/{number}","comments_url":"https://api.github.com/repos/andycandrea/hnews/issues/21/comments","statuses_url":"https://api.github.com/repos/andycandrea/hnews/statuses/1eb80010b2898b19f7379cb452c124720a086f70","head":{"label":"andycandrea:password-reset","ref":"password-reset","sha":"1eb80010b2898b19f7379cb452c124720a086f70","user":{"login":"andycandrea","id":5621517,"avatar_url":"https://avatars.githubusercontent.com/u/5621517?","gravatar_id":"fba559ba333b8173b21fef7fa05142b1","url":"https://api.github.com/users/andycandrea","html_url":"https://github.com/andycandrea","followers_url":"https://api.github.com/users/andycandrea/followers","following_url":"https://api.github.com/users/andycandrea/following{/other_user}","gists_url":"https://api.github.com/users/andycandrea/gists{/gist_id}","starred_url":"https://api.github.com/users/andycandrea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andycandrea/subscriptions","organizations_url":"https://api.github.com/users/andycandrea/orgs","repos_url":"https://api.github.com/users/andycandrea/repos","events_url":"https://api.github.com/users/andycandrea/events{/privacy}","received_events_url":"https://api.github.com/users/andycandrea/received_events","type":"User","site_admin":false},"repo":{"id":20885657,"name":"hnews","full_name":"andycandrea/hnews","owner":{"login":"andycandrea","id":5621517,"avatar_url":"https://avatars.githubusercontent.com/u/5621517?","gravatar_id":"fba559ba333b8173b21fef7fa05142b1","url":"https://api.github.com/users/andycandrea","html_url":"https://github.com/andycandrea","followers_url":"https://api.github.com/users/andycandrea/followers","following_url":"https://api.github.com/users/andycandrea/following{/other_user}","gists_url":"https://api.github.com/users/andycandrea/gists{/gist_id}","starred_url":"https://api.github.com/users/andycandrea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andycandrea/subscriptions","organizations_url":"https://api.github.com/users/andycandrea/orgs","repos_url":"https://api.github.com/users/andycandrea/repos","events_url":"https://api.github.com/users/andycandrea/events{/privacy}","received_events_url":"https://api.github.com/users/andycandrea/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andycandrea/hnews","description":"Clone of Hacker News","fork":false,"url":"https://api.github.com/repos/andycandrea/hnews","forks_url":"https://api.github.com/repos/andycandrea/hnews/forks","keys_url":"https://api.github.com/repos/andycandrea/hnews/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andycandrea/hnews/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andycandrea/hnews/teams","hooks_url":"https://api.github.com/repos/andycandrea/hnews/hooks","issue_events_url":"https://api.github.com/repos/andycandrea/hnews/issues/events{/number}","events_url":"https://api.github.com/repos/andycandrea/hnews/events","assignees_url":"https://api.github.com/repos/andycandrea/hnews/assignees{/user}","branches_url":"https://api.github.com/repos/andycandrea/hnews/branches{/branch}","tags_url":"https://api.github.com/repos/andycandrea/hnews/tags","blobs_url":"https://api.github.com/repos/andycandrea/hnews/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andycandrea/hnews/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andycandrea/hnews/git/refs{/sha}","trees_url":"https://api.github.com/repos/andycandrea/hnews/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andycandrea/hnews/statuses/{sha}","languages_url":"https://api.github.com/repos/andycandrea/hnews/languages","stargazers_url":"https://api.github.com/repos/andycandrea/hnews/stargazers","contributors_url":"https://api.github.com/repos/andycandrea/hnews/contributors","subscribers_url":"https://api.github.com/repos/andycandrea/hnews/subscribers","subscription_url":"https://api.github.com/repos/andycandrea/hnews/subscription","commits_url":"https://api.github.com/repos/andycandrea/hnews/commits{/sha}","git_commits_url":"https://api.github.com/repos/andycandrea/hnews/git/commits{/sha}","comments_url":"https://api.github.com/repos/andycandrea/hnews/comments{/number}","issue_comment_url":"https://api.github.com/repos/andycandrea/hnews/issues/comments/{number}","contents_url":"https://api.github.com/repos/andycandrea/hnews/contents/{+path}","compare_url":"https://api.github.com/repos/andycandrea/hnews/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andycandrea/hnews/merges","archive_url":"https://api.github.com/repos/andycandrea/hnews/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andycandrea/hnews/downloads","issues_url":"https://api.github.com/repos/andycandrea/hnews/issues{/number}","pulls_url":"https://api.github.com/repos/andycandrea/hnews/pulls{/number}","milestones_url":"https://api.github.com/repos/andycandrea/hnews/milestones{/number}","notifications_url":"https://api.github.com/repos/andycandrea/hnews/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andycandrea/hnews/labels{/name}","releases_url":"https://api.github.com/repos/andycandrea/hnews/releases{/id}","created_at":"2014-06-16T13:24:12Z","updated_at":"2014-06-27T21:17:45Z","pushed_at":"2014-07-08T14:49:09Z","git_url":"git://github.com/andycandrea/hnews.git","ssh_url":"git@github.com:andycandrea/hnews.git","clone_url":"https://github.com/andycandrea/hnews.git","svn_url":"https://github.com/andycandrea/hnews","homepage":null,"size":816,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"base":{"label":"andycandrea:master","ref":"master","sha":"437b7e909a7c4a5a33cc433ab29a2486e38708e2","user":{"login":"andycandrea","id":5621517,"avatar_url":"https://avatars.githubusercontent.com/u/5621517?","gravatar_id":"fba559ba333b8173b21fef7fa05142b1","url":"https://api.github.com/users/andycandrea","html_url":"https://github.com/andycandrea","followers_url":"https://api.github.com/users/andycandrea/followers","following_url":"https://api.github.com/users/andycandrea/following{/other_user}","gists_url":"https://api.github.com/users/andycandrea/gists{/gist_id}","starred_url":"https://api.github.com/users/andycandrea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andycandrea/subscriptions","organizations_url":"https://api.github.com/users/andycandrea/orgs","repos_url":"https://api.github.com/users/andycandrea/repos","events_url":"https://api.github.com/users/andycandrea/events{/privacy}","received_events_url":"https://api.github.com/users/andycandrea/received_events","type":"User","site_admin":false},"repo":{"id":20885657,"name":"hnews","full_name":"andycandrea/hnews","owner":{"login":"andycandrea","id":5621517,"avatar_url":"https://avatars.githubusercontent.com/u/5621517?","gravatar_id":"fba559ba333b8173b21fef7fa05142b1","url":"https://api.github.com/users/andycandrea","html_url":"https://github.com/andycandrea","followers_url":"https://api.github.com/users/andycandrea/followers","following_url":"https://api.github.com/users/andycandrea/following{/other_user}","gists_url":"https://api.github.com/users/andycandrea/gists{/gist_id}","starred_url":"https://api.github.com/users/andycandrea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andycandrea/subscriptions","organizations_url":"https://api.github.com/users/andycandrea/orgs","repos_url":"https://api.github.com/users/andycandrea/repos","events_url":"https://api.github.com/users/andycandrea/events{/privacy}","received_events_url":"https://api.github.com/users/andycandrea/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andycandrea/hnews","description":"Clone of Hacker News","fork":false,"url":"https://api.github.com/repos/andycandrea/hnews","forks_url":"https://api.github.com/repos/andycandrea/hnews/forks","keys_url":"https://api.github.com/repos/andycandrea/hnews/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andycandrea/hnews/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andycandrea/hnews/teams","hooks_url":"https://api.github.com/repos/andycandrea/hnews/hooks","issue_events_url":"https://api.github.com/repos/andycandrea/hnews/issues/events{/number}","events_url":"https://api.github.com/repos/andycandrea/hnews/events","assignees_url":"https://api.github.com/repos/andycandrea/hnews/assignees{/user}","branches_url":"https://api.github.com/repos/andycandrea/hnews/branches{/branch}","tags_url":"https://api.github.com/repos/andycandrea/hnews/tags","blobs_url":"https://api.github.com/repos/andycandrea/hnews/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andycandrea/hnews/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andycandrea/hnews/git/refs{/sha}","trees_url":"https://api.github.com/repos/andycandrea/hnews/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andycandrea/hnews/statuses/{sha}","languages_url":"https://api.github.com/repos/andycandrea/hnews/languages","stargazers_url":"https://api.github.com/repos/andycandrea/hnews/stargazers","contributors_url":"https://api.github.com/repos/andycandrea/hnews/contributors","subscribers_url":"https://api.github.com/repos/andycandrea/hnews/subscribers","subscription_url":"https://api.github.com/repos/andycandrea/hnews/subscription","commits_url":"https://api.github.com/repos/andycandrea/hnews/commits{/sha}","git_commits_url":"https://api.github.com/repos/andycandrea/hnews/git/commits{/sha}","comments_url":"https://api.github.com/repos/andycandrea/hnews/comments{/number}","issue_comment_url":"https://api.github.com/repos/andycandrea/hnews/issues/comments/{number}","contents_url":"https://api.github.com/repos/andycandrea/hnews/contents/{+path}","compare_url":"https://api.github.com/repos/andycandrea/hnews/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andycandrea/hnews/merges","archive_url":"https://api.github.com/repos/andycandrea/hnews/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andycandrea/hnews/downloads","issues_url":"https://api.github.com/repos/andycandrea/hnews/issues{/number}","pulls_url":"https://api.github.com/repos/andycandrea/hnews/pulls{/number}","milestones_url":"https://api.github.com/repos/andycandrea/hnews/milestones{/number}","notifications_url":"https://api.github.com/repos/andycandrea/hnews/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andycandrea/hnews/labels{/name}","releases_url":"https://api.github.com/repos/andycandrea/hnews/releases{/id}","created_at":"2014-06-16T13:24:12Z","updated_at":"2014-06-27T21:17:45Z","pushed_at":"2014-07-08T14:49:09Z","git_url":"git://github.com/andycandrea/hnews.git","ssh_url":"git@github.com:andycandrea/hnews.git","clone_url":"https://github.com/andycandrea/hnews.git","svn_url":"https://github.com/andycandrea/hnews","homepage":null,"size":816,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andycandrea/hnews/pulls/21"},"html":{"href":"https://github.com/andycandrea/hnews/pull/21"},"issue":{"href":"https://api.github.com/repos/andycandrea/hnews/issues/21"},"comments":{"href":"https://api.github.com/repos/andycandrea/hnews/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/andycandrea/hnews/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/andycandrea/hnews/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/andycandrea/hnews/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/andycandrea/hnews/statuses/1eb80010b2898b19f7379cb452c124720a086f70"}}}}