{"action":"created","comment":{"url":"https://api.github.com/repos/jepetko/myflix/pulls/comments/41099421","id":41099421,"diff_hunk":"@@ -0,0 +1,41 @@\n+class PasswordsController < ApplicationController\n+\n+  def new\n+  end\n+\n+  def create\n+    email = params[:email]\n+    user = User.find_by_email(email)\n+    if user\n+      user.reset_password_token = SecureRandom.urlsafe_base64\n+      user.save\n+      AppMailer.send_mail_on_reset_password(user).deliver\n+      render 'passwords/confirm'\n+    end\n+  end\n+\n+  def edit\n+    @token = params[:token]\n+    @user = User.find_by_reset_password_token(@token)\n+    if !@user\n+      flash[:error] = 'Your reset password link is expired.'","path":"app/controllers/passwords_controller.rb","position":21,"original_position":21,"commit_id":"e1a1cac2138d26ac21096b46a3ebb0b9b2fb322e","original_commit_id":"e1a1cac2138d26ac21096b46a3ebb0b9b2fb322e","user":{"login":"brandoncc","id":543973,"avatar_url":"https://avatars.githubusercontent.com/u/543973?v=3","gravatar_id":"","url":"https://api.github.com/users/brandoncc","html_url":"https://github.com/brandoncc","followers_url":"https://api.github.com/users/brandoncc/followers","following_url":"https://api.github.com/users/brandoncc/following{/other_user}","gists_url":"https://api.github.com/users/brandoncc/gists{/gist_id}","starred_url":"https://api.github.com/users/brandoncc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandoncc/subscriptions","organizations_url":"https://api.github.com/users/brandoncc/orgs","repos_url":"https://api.github.com/users/brandoncc/repos","events_url":"https://api.github.com/users/brandoncc/events{/privacy}","received_events_url":"https://api.github.com/users/brandoncc/received_events","type":"User","site_admin":false},"body":"Bootstrap 3 uses \"danger\" instead of \"error\" and \"success\" instead of \"notice\".","created_at":"2015-10-04T16:45:10Z","updated_at":"2015-10-04T16:45:10Z","html_url":"https://github.com/jepetko/myflix/pull/6#discussion_r41099421","pull_request_url":"https://api.github.com/repos/jepetko/myflix/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/jepetko/myflix/pulls/comments/41099421"},"html":{"href":"https://github.com/jepetko/myflix/pull/6#discussion_r41099421"},"pull_request":{"href":"https://api.github.com/repos/jepetko/myflix/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/jepetko/myflix/pulls/6","id":46721843,"html_url":"https://github.com/jepetko/myflix/pull/6","diff_url":"https://github.com/jepetko/myflix/pull/6.diff","patch_url":"https://github.com/jepetko/myflix/pull/6.patch","issue_url":"https://api.github.com/repos/jepetko/myflix/issues/6","number":6,"state":"open","locked":false,"title":"Week 4 sending mails","user":{"login":"jepetko","id":1812641,"avatar_url":"https://avatars.githubusercontent.com/u/1812641?v=3","gravatar_id":"","url":"https://api.github.com/users/jepetko","html_url":"https://github.com/jepetko","followers_url":"https://api.github.com/users/jepetko/followers","following_url":"https://api.github.com/users/jepetko/following{/other_user}","gists_url":"https://api.github.com/users/jepetko/gists{/gist_id}","starred_url":"https://api.github.com/users/jepetko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jepetko/subscriptions","organizations_url":"https://api.github.com/users/jepetko/orgs","repos_url":"https://api.github.com/users/jepetko/repos","events_url":"https://api.github.com/users/jepetko/events{/privacy}","received_events_url":"https://api.github.com/users/jepetko/received_events","type":"User","site_admin":false},"body":"Assignments:\r\n14: Sending mails\r\n16: Testing for sending mails\r\n18: Reset Password","created_at":"2015-10-04T08:55:18Z","updated_at":"2015-10-04T16:45:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c14413aa8e2756fa40e296f388c0cf7d4ae6ac77","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jepetko/myflix/pulls/6/commits","review_comments_url":"https://api.github.com/repos/jepetko/myflix/pulls/6/comments","review_comment_url":"https://api.github.com/repos/jepetko/myflix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jepetko/myflix/issues/6/comments","statuses_url":"https://api.github.com/repos/jepetko/myflix/statuses/e1a1cac2138d26ac21096b46a3ebb0b9b2fb322e","head":{"label":"jepetko:week-4-sending-mails","ref":"week-4-sending-mails","sha":"e1a1cac2138d26ac21096b46a3ebb0b9b2fb322e","user":{"login":"jepetko","id":1812641,"avatar_url":"https://avatars.githubusercontent.com/u/1812641?v=3","gravatar_id":"","url":"https://api.github.com/users/jepetko","html_url":"https://github.com/jepetko","followers_url":"https://api.github.com/users/jepetko/followers","following_url":"https://api.github.com/users/jepetko/following{/other_user}","gists_url":"https://api.github.com/users/jepetko/gists{/gist_id}","starred_url":"https://api.github.com/users/jepetko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jepetko/subscriptions","organizations_url":"https://api.github.com/users/jepetko/orgs","repos_url":"https://api.github.com/users/jepetko/repos","events_url":"https://api.github.com/users/jepetko/events{/privacy}","received_events_url":"https://api.github.com/users/jepetko/received_events","type":"User","site_admin":false},"repo":{"id":33948139,"name":"myflix","full_name":"jepetko/myflix","owner":{"login":"jepetko","id":1812641,"avatar_url":"https://avatars.githubusercontent.com/u/1812641?v=3","gravatar_id":"","url":"https://api.github.com/users/jepetko","html_url":"https://github.com/jepetko","followers_url":"https://api.github.com/users/jepetko/followers","following_url":"https://api.github.com/users/jepetko/following{/other_user}","gists_url":"https://api.github.com/users/jepetko/gists{/gist_id}","starred_url":"https://api.github.com/users/jepetko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jepetko/subscriptions","organizations_url":"https://api.github.com/users/jepetko/orgs","repos_url":"https://api.github.com/users/jepetko/repos","events_url":"https://api.github.com/users/jepetko/events{/privacy}","received_events_url":"https://api.github.com/users/jepetko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jepetko/myflix","description":"myflix tealeaf course application","fork":false,"url":"https://api.github.com/repos/jepetko/myflix","forks_url":"https://api.github.com/repos/jepetko/myflix/forks","keys_url":"https://api.github.com/repos/jepetko/myflix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jepetko/myflix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jepetko/myflix/teams","hooks_url":"https://api.github.com/repos/jepetko/myflix/hooks","issue_events_url":"https://api.github.com/repos/jepetko/myflix/issues/events{/number}","events_url":"https://api.github.com/repos/jepetko/myflix/events","assignees_url":"https://api.github.com/repos/jepetko/myflix/assignees{/user}","branches_url":"https://api.github.com/repos/jepetko/myflix/branches{/branch}","tags_url":"https://api.github.com/repos/jepetko/myflix/tags","blobs_url":"https://api.github.com/repos/jepetko/myflix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jepetko/myflix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jepetko/myflix/git/refs{/sha}","trees_url":"https://api.github.com/repos/jepetko/myflix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jepetko/myflix/statuses/{sha}","languages_url":"https://api.github.com/repos/jepetko/myflix/languages","stargazers_url":"https://api.github.com/repos/jepetko/myflix/stargazers","contributors_url":"https://api.github.com/repos/jepetko/myflix/contributors","subscribers_url":"https://api.github.com/repos/jepetko/myflix/subscribers","subscription_url":"https://api.github.com/repos/jepetko/myflix/subscription","commits_url":"https://api.github.com/repos/jepetko/myflix/commits{/sha}","git_commits_url":"https://api.github.com/repos/jepetko/myflix/git/commits{/sha}","comments_url":"https://api.github.com/repos/jepetko/myflix/comments{/number}","issue_comment_url":"https://api.github.com/repos/jepetko/myflix/issues/comments{/number}","contents_url":"https://api.github.com/repos/jepetko/myflix/contents/{+path}","compare_url":"https://api.github.com/repos/jepetko/myflix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jepetko/myflix/merges","archive_url":"https://api.github.com/repos/jepetko/myflix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jepetko/myflix/downloads","issues_url":"https://api.github.com/repos/jepetko/myflix/issues{/number}","pulls_url":"https://api.github.com/repos/jepetko/myflix/pulls{/number}","milestones_url":"https://api.github.com/repos/jepetko/myflix/milestones{/number}","notifications_url":"https://api.github.com/repos/jepetko/myflix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jepetko/myflix/labels{/name}","releases_url":"https://api.github.com/repos/jepetko/myflix/releases{/id}","created_at":"2015-04-14T18:01:44Z","updated_at":"2015-05-02T10:22:05Z","pushed_at":"2015-10-04T08:55:18Z","git_url":"git://github.com/jepetko/myflix.git","ssh_url":"git@github.com:jepetko/myflix.git","clone_url":"https://github.com/jepetko/myflix.git","svn_url":"https://github.com/jepetko/myflix","homepage":null,"size":724,"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":"jepetko:master","ref":"master","sha":"a501dd83844f99e2c60ebc59f40e68637783f27a","user":{"login":"jepetko","id":1812641,"avatar_url":"https://avatars.githubusercontent.com/u/1812641?v=3","gravatar_id":"","url":"https://api.github.com/users/jepetko","html_url":"https://github.com/jepetko","followers_url":"https://api.github.com/users/jepetko/followers","following_url":"https://api.github.com/users/jepetko/following{/other_user}","gists_url":"https://api.github.com/users/jepetko/gists{/gist_id}","starred_url":"https://api.github.com/users/jepetko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jepetko/subscriptions","organizations_url":"https://api.github.com/users/jepetko/orgs","repos_url":"https://api.github.com/users/jepetko/repos","events_url":"https://api.github.com/users/jepetko/events{/privacy}","received_events_url":"https://api.github.com/users/jepetko/received_events","type":"User","site_admin":false},"repo":{"id":33948139,"name":"myflix","full_name":"jepetko/myflix","owner":{"login":"jepetko","id":1812641,"avatar_url":"https://avatars.githubusercontent.com/u/1812641?v=3","gravatar_id":"","url":"https://api.github.com/users/jepetko","html_url":"https://github.com/jepetko","followers_url":"https://api.github.com/users/jepetko/followers","following_url":"https://api.github.com/users/jepetko/following{/other_user}","gists_url":"https://api.github.com/users/jepetko/gists{/gist_id}","starred_url":"https://api.github.com/users/jepetko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jepetko/subscriptions","organizations_url":"https://api.github.com/users/jepetko/orgs","repos_url":"https://api.github.com/users/jepetko/repos","events_url":"https://api.github.com/users/jepetko/events{/privacy}","received_events_url":"https://api.github.com/users/jepetko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jepetko/myflix","description":"myflix tealeaf course application","fork":false,"url":"https://api.github.com/repos/jepetko/myflix","forks_url":"https://api.github.com/repos/jepetko/myflix/forks","keys_url":"https://api.github.com/repos/jepetko/myflix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jepetko/myflix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jepetko/myflix/teams","hooks_url":"https://api.github.com/repos/jepetko/myflix/hooks","issue_events_url":"https://api.github.com/repos/jepetko/myflix/issues/events{/number}","events_url":"https://api.github.com/repos/jepetko/myflix/events","assignees_url":"https://api.github.com/repos/jepetko/myflix/assignees{/user}","branches_url":"https://api.github.com/repos/jepetko/myflix/branches{/branch}","tags_url":"https://api.github.com/repos/jepetko/myflix/tags","blobs_url":"https://api.github.com/repos/jepetko/myflix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jepetko/myflix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jepetko/myflix/git/refs{/sha}","trees_url":"https://api.github.com/repos/jepetko/myflix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jepetko/myflix/statuses/{sha}","languages_url":"https://api.github.com/repos/jepetko/myflix/languages","stargazers_url":"https://api.github.com/repos/jepetko/myflix/stargazers","contributors_url":"https://api.github.com/repos/jepetko/myflix/contributors","subscribers_url":"https://api.github.com/repos/jepetko/myflix/subscribers","subscription_url":"https://api.github.com/repos/jepetko/myflix/subscription","commits_url":"https://api.github.com/repos/jepetko/myflix/commits{/sha}","git_commits_url":"https://api.github.com/repos/jepetko/myflix/git/commits{/sha}","comments_url":"https://api.github.com/repos/jepetko/myflix/comments{/number}","issue_comment_url":"https://api.github.com/repos/jepetko/myflix/issues/comments{/number}","contents_url":"https://api.github.com/repos/jepetko/myflix/contents/{+path}","compare_url":"https://api.github.com/repos/jepetko/myflix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jepetko/myflix/merges","archive_url":"https://api.github.com/repos/jepetko/myflix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jepetko/myflix/downloads","issues_url":"https://api.github.com/repos/jepetko/myflix/issues{/number}","pulls_url":"https://api.github.com/repos/jepetko/myflix/pulls{/number}","milestones_url":"https://api.github.com/repos/jepetko/myflix/milestones{/number}","notifications_url":"https://api.github.com/repos/jepetko/myflix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jepetko/myflix/labels{/name}","releases_url":"https://api.github.com/repos/jepetko/myflix/releases{/id}","created_at":"2015-04-14T18:01:44Z","updated_at":"2015-05-02T10:22:05Z","pushed_at":"2015-10-04T08:55:18Z","git_url":"git://github.com/jepetko/myflix.git","ssh_url":"git@github.com:jepetko/myflix.git","clone_url":"https://github.com/jepetko/myflix.git","svn_url":"https://github.com/jepetko/myflix","homepage":null,"size":724,"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/jepetko/myflix/pulls/6"},"html":{"href":"https://github.com/jepetko/myflix/pull/6"},"issue":{"href":"https://api.github.com/repos/jepetko/myflix/issues/6"},"comments":{"href":"https://api.github.com/repos/jepetko/myflix/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/jepetko/myflix/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/jepetko/myflix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jepetko/myflix/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/jepetko/myflix/statuses/e1a1cac2138d26ac21096b46a3ebb0b9b2fb322e"}}}}