{"action":"created","comment":{"url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls/comments/84970579","pull_request_review_id":5713505,"id":84970579,"diff_hunk":"@@ -29,6 +29,11 @@ bugReportSchema.pre('save', function(next) {\n   next();\n });\n \n+bugReportSchema.post('save', function(report) {\n+  var notify = require('../helpers/notification');\n+  notify('Bug Report', 'Bug', this.created_at, this.file, '/bug-reports/', this._id);","path":"models/bug_report.js","position":6,"original_position":6,"commit_id":"22b7f7336589dbfbd8250b1ce3795a033b915355","original_commit_id":"22b7f7336589dbfbd8250b1ce3795a033b915355","user":{"login":"danschultzer","id":1254724,"avatar_url":"https://avatars.githubusercontent.com/u/1254724?v=3","gravatar_id":"","url":"https://api.github.com/users/danschultzer","html_url":"https://github.com/danschultzer","followers_url":"https://api.github.com/users/danschultzer/followers","following_url":"https://api.github.com/users/danschultzer/following{/other_user}","gists_url":"https://api.github.com/users/danschultzer/gists{/gist_id}","starred_url":"https://api.github.com/users/danschultzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danschultzer/subscriptions","organizations_url":"https://api.github.com/users/danschultzer/orgs","repos_url":"https://api.github.com/users/danschultzer/repos","events_url":"https://api.github.com/users/danschultzer/events{/privacy}","received_events_url":"https://api.github.com/users/danschultzer/received_events","type":"User","site_admin":false},"body":"You can just pass the object itself instead of passing `this.created_at`, etc. So it's `notify(type, object, endpoint)`, e.g. \r\n```\r\nnotify('Bug', this, `/api/v1/bug-reports/${this._id}`)\r\n```","created_at":"2016-10-25T18:34:10Z","updated_at":"2016-10-25T18:40:55Z","html_url":"https://github.com/danschultzer/blazing-bookkeeper-server/pull/2#discussion_r84970579","pull_request_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls/comments/84970579"},"html":{"href":"https://github.com/danschultzer/blazing-bookkeeper-server/pull/2#discussion_r84970579"},"pull_request":{"href":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls/2","id":90725015,"html_url":"https://github.com/danschultzer/blazing-bookkeeper-server/pull/2","diff_url":"https://github.com/danschultzer/blazing-bookkeeper-server/pull/2.diff","patch_url":"https://github.com/danschultzer/blazing-bookkeeper-server/pull/2.patch","issue_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/issues/2","number":2,"state":"open","locked":false,"title":"Email notification","user":{"login":"Schultzer","id":10013742,"avatar_url":"https://avatars.githubusercontent.com/u/10013742?v=3","gravatar_id":"","url":"https://api.github.com/users/Schultzer","html_url":"https://github.com/Schultzer","followers_url":"https://api.github.com/users/Schultzer/followers","following_url":"https://api.github.com/users/Schultzer/following{/other_user}","gists_url":"https://api.github.com/users/Schultzer/gists{/gist_id}","starred_url":"https://api.github.com/users/Schultzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schultzer/subscriptions","organizations_url":"https://api.github.com/users/Schultzer/orgs","repos_url":"https://api.github.com/users/Schultzer/repos","events_url":"https://api.github.com/users/Schultzer/events{/privacy}","received_events_url":"https://api.github.com/users/Schultzer/received_events","type":"User","site_admin":false},"body":"### This will add email notification\r\n\r\n- [x] Send and receive Email notification.\r\n- [x] Make argument `date`, `file`, `id` work currently they are `undefined`.\r\n- ~~Write tests.~~\r\n\r\nTest and clean up of the whole server will be in another PR.\r\n\r\nThis  PR are ready for 👀  @danschultzer ","created_at":"2016-10-25T01:47:11Z","updated_at":"2016-10-25T18:40:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"08c6f33788beec21559acb14f71a5d23bf780813","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls/2/commits","review_comments_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls/2/comments","review_comment_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/issues/2/comments","statuses_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/statuses/22b7f7336589dbfbd8250b1ce3795a033b915355","head":{"label":"danschultzer:email-notification","ref":"email-notification","sha":"22b7f7336589dbfbd8250b1ce3795a033b915355","user":{"login":"danschultzer","id":1254724,"avatar_url":"https://avatars.githubusercontent.com/u/1254724?v=3","gravatar_id":"","url":"https://api.github.com/users/danschultzer","html_url":"https://github.com/danschultzer","followers_url":"https://api.github.com/users/danschultzer/followers","following_url":"https://api.github.com/users/danschultzer/following{/other_user}","gists_url":"https://api.github.com/users/danschultzer/gists{/gist_id}","starred_url":"https://api.github.com/users/danschultzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danschultzer/subscriptions","organizations_url":"https://api.github.com/users/danschultzer/orgs","repos_url":"https://api.github.com/users/danschultzer/repos","events_url":"https://api.github.com/users/danschultzer/events{/privacy}","received_events_url":"https://api.github.com/users/danschultzer/received_events","type":"User","site_admin":false},"repo":{"id":70538057,"name":"blazing-bookkeeper-server","full_name":"danschultzer/blazing-bookkeeper-server","owner":{"login":"danschultzer","id":1254724,"avatar_url":"https://avatars.githubusercontent.com/u/1254724?v=3","gravatar_id":"","url":"https://api.github.com/users/danschultzer","html_url":"https://github.com/danschultzer","followers_url":"https://api.github.com/users/danschultzer/followers","following_url":"https://api.github.com/users/danschultzer/following{/other_user}","gists_url":"https://api.github.com/users/danschultzer/gists{/gist_id}","starred_url":"https://api.github.com/users/danschultzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danschultzer/subscriptions","organizations_url":"https://api.github.com/users/danschultzer/orgs","repos_url":"https://api.github.com/users/danschultzer/repos","events_url":"https://api.github.com/users/danschultzer/events{/privacy}","received_events_url":"https://api.github.com/users/danschultzer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danschultzer/blazing-bookkeeper-server","description":null,"fork":false,"url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server","forks_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/forks","keys_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/teams","hooks_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/hooks","issue_events_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/issues/events{/number}","events_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/events","assignees_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/assignees{/user}","branches_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/branches{/branch}","tags_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/tags","blobs_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/statuses/{sha}","languages_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/languages","stargazers_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/stargazers","contributors_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/contributors","subscribers_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/subscribers","subscription_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/subscription","commits_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/contents/{+path}","compare_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/merges","archive_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/downloads","issues_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/issues{/number}","pulls_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls{/number}","milestones_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/milestones{/number}","notifications_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/labels{/name}","releases_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/releases{/id}","deployments_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/deployments","created_at":"2016-10-10T23:45:12Z","updated_at":"2016-10-23T21:52:15Z","pushed_at":"2016-10-25T05:57:42Z","git_url":"git://github.com/danschultzer/blazing-bookkeeper-server.git","ssh_url":"git@github.com:danschultzer/blazing-bookkeeper-server.git","clone_url":"https://github.com/danschultzer/blazing-bookkeeper-server.git","svn_url":"https://github.com/danschultzer/blazing-bookkeeper-server","homepage":null,"size":2010,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","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":2,"default_branch":"master"}},"base":{"label":"danschultzer:master","ref":"master","sha":"cc83fa58ef4b9a4d373cc34f329d4edc5a795167","user":{"login":"danschultzer","id":1254724,"avatar_url":"https://avatars.githubusercontent.com/u/1254724?v=3","gravatar_id":"","url":"https://api.github.com/users/danschultzer","html_url":"https://github.com/danschultzer","followers_url":"https://api.github.com/users/danschultzer/followers","following_url":"https://api.github.com/users/danschultzer/following{/other_user}","gists_url":"https://api.github.com/users/danschultzer/gists{/gist_id}","starred_url":"https://api.github.com/users/danschultzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danschultzer/subscriptions","organizations_url":"https://api.github.com/users/danschultzer/orgs","repos_url":"https://api.github.com/users/danschultzer/repos","events_url":"https://api.github.com/users/danschultzer/events{/privacy}","received_events_url":"https://api.github.com/users/danschultzer/received_events","type":"User","site_admin":false},"repo":{"id":70538057,"name":"blazing-bookkeeper-server","full_name":"danschultzer/blazing-bookkeeper-server","owner":{"login":"danschultzer","id":1254724,"avatar_url":"https://avatars.githubusercontent.com/u/1254724?v=3","gravatar_id":"","url":"https://api.github.com/users/danschultzer","html_url":"https://github.com/danschultzer","followers_url":"https://api.github.com/users/danschultzer/followers","following_url":"https://api.github.com/users/danschultzer/following{/other_user}","gists_url":"https://api.github.com/users/danschultzer/gists{/gist_id}","starred_url":"https://api.github.com/users/danschultzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danschultzer/subscriptions","organizations_url":"https://api.github.com/users/danschultzer/orgs","repos_url":"https://api.github.com/users/danschultzer/repos","events_url":"https://api.github.com/users/danschultzer/events{/privacy}","received_events_url":"https://api.github.com/users/danschultzer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danschultzer/blazing-bookkeeper-server","description":null,"fork":false,"url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server","forks_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/forks","keys_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/teams","hooks_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/hooks","issue_events_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/issues/events{/number}","events_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/events","assignees_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/assignees{/user}","branches_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/branches{/branch}","tags_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/tags","blobs_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/statuses/{sha}","languages_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/languages","stargazers_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/stargazers","contributors_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/contributors","subscribers_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/subscribers","subscription_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/subscription","commits_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/contents/{+path}","compare_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/merges","archive_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/downloads","issues_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/issues{/number}","pulls_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls{/number}","milestones_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/milestones{/number}","notifications_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/labels{/name}","releases_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/releases{/id}","deployments_url":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/deployments","created_at":"2016-10-10T23:45:12Z","updated_at":"2016-10-23T21:52:15Z","pushed_at":"2016-10-25T05:57:42Z","git_url":"git://github.com/danschultzer/blazing-bookkeeper-server.git","ssh_url":"git@github.com:danschultzer/blazing-bookkeeper-server.git","clone_url":"https://github.com/danschultzer/blazing-bookkeeper-server.git","svn_url":"https://github.com/danschultzer/blazing-bookkeeper-server","homepage":null,"size":2010,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","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":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls/2"},"html":{"href":"https://github.com/danschultzer/blazing-bookkeeper-server/pull/2"},"issue":{"href":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/issues/2"},"comments":{"href":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/danschultzer/blazing-bookkeeper-server/statuses/22b7f7336589dbfbd8250b1ce3795a033b915355"}}}}
{"actor":{"display_login":"danschultzer"}}