{"action":"created","comment":{"url":"https://api.github.com/repos/Plume-org/Plume/pulls/comments/241563936","pull_request_review_id":184871979,"id":241563936,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTU2MzkzNg==","diff_hunk":"@@ -48,6 +48,15 @@ impl Notification {\n             .expect(\"Notification::find_for_user: notification loading error\")\n     }\n \n+    pub fn count_for_user(conn: &Connection, user: &User) -> i64 {\n+        notifications::table\n+            .filter(notifications::user_id.eq(user.id))\n+            .order_by(notifications::creation_date.desc())","path":"plume-models/src/notifications.rs","position":7,"original_position":7,"commit_id":"5f97950277627135abb4baff6bbb215af4f17f03","original_commit_id":"5f97950277627135abb4baff6bbb215af4f17f03","user":{"login":"BaptisteGelez","id":16254623,"node_id":"MDQ6VXNlcjE2MjU0NjIz","avatar_url":"https://avatars1.githubusercontent.com/u/16254623?v=4","gravatar_id":"","url":"https://api.github.com/users/BaptisteGelez","html_url":"https://github.com/BaptisteGelez","followers_url":"https://api.github.com/users/BaptisteGelez/followers","following_url":"https://api.github.com/users/BaptisteGelez/following{/other_user}","gists_url":"https://api.github.com/users/BaptisteGelez/gists{/gist_id}","starred_url":"https://api.github.com/users/BaptisteGelez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BaptisteGelez/subscriptions","organizations_url":"https://api.github.com/users/BaptisteGelez/orgs","repos_url":"https://api.github.com/users/BaptisteGelez/repos","events_url":"https://api.github.com/users/BaptisteGelez/events{/privacy}","received_events_url":"https://api.github.com/users/BaptisteGelez/received_events","type":"User","site_admin":false},"body":"Yes, I just copy/pasted another function. I'll change that.","created_at":"2018-12-13T21:15:58Z","updated_at":"2018-12-13T21:15:59Z","html_url":"https://github.com/Plume-org/Plume/pull/344#discussion_r241563936","pull_request_url":"https://api.github.com/repos/Plume-org/Plume/pulls/344","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Plume-org/Plume/pulls/comments/241563936"},"html":{"href":"https://github.com/Plume-org/Plume/pull/344#discussion_r241563936"},"pull_request":{"href":"https://api.github.com/repos/Plume-org/Plume/pulls/344"}},"in_reply_to_id":241552373},"pull_request":{"url":"https://api.github.com/repos/Plume-org/Plume/pulls/344","id":237151203,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MTUxMjAz","html_url":"https://github.com/Plume-org/Plume/pull/344","diff_url":"https://github.com/Plume-org/Plume/pull/344.diff","patch_url":"https://github.com/Plume-org/Plume/pull/344.patch","issue_url":"https://api.github.com/repos/Plume-org/Plume/issues/344","number":344,"state":"open","locked":false,"title":"Count items in database as much as possible","user":{"login":"BaptisteGelez","id":16254623,"node_id":"MDQ6VXNlcjE2MjU0NjIz","avatar_url":"https://avatars1.githubusercontent.com/u/16254623?v=4","gravatar_id":"","url":"https://api.github.com/users/BaptisteGelez","html_url":"https://github.com/BaptisteGelez","followers_url":"https://api.github.com/users/BaptisteGelez/followers","following_url":"https://api.github.com/users/BaptisteGelez/following{/other_user}","gists_url":"https://api.github.com/users/BaptisteGelez/gists{/gist_id}","starred_url":"https://api.github.com/users/BaptisteGelez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BaptisteGelez/subscriptions","organizations_url":"https://api.github.com/users/BaptisteGelez/orgs","repos_url":"https://api.github.com/users/BaptisteGelez/repos","events_url":"https://api.github.com/users/BaptisteGelez/events{/privacy}","received_events_url":"https://api.github.com/users/BaptisteGelez/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-12-09T19:26:27Z","updated_at":"2018-12-13T21:15:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9735cc41cb1c112eb9c659ad656c884163db7ba","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":996694866,"node_id":"MDU6TGFiZWw5OTY2OTQ4NjY=","url":"https://api.github.com/repos/Plume-org/Plume/labels/A:%20Backend","name":"A: Backend","color":"1d76db","default":false},{"id":909397038,"node_id":"MDU6TGFiZWw5MDkzOTcwMzg=","url":"https://api.github.com/repos/Plume-org/Plume/labels/C:%20Enhancement","name":"C: Enhancement","color":"a2eeef","default":false},{"id":919675490,"node_id":"MDU6TGFiZWw5MTk2NzU0OTA=","url":"https://api.github.com/repos/Plume-org/Plume/labels/S:%20Ready%20for%20review","name":"S: Ready for review","color":"f9b8ef","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Plume-org/Plume/pulls/344/commits","review_comments_url":"https://api.github.com/repos/Plume-org/Plume/pulls/344/comments","review_comment_url":"https://api.github.com/repos/Plume-org/Plume/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Plume-org/Plume/issues/344/comments","statuses_url":"https://api.github.com/repos/Plume-org/Plume/statuses/5f97950277627135abb4baff6bbb215af4f17f03","head":{"label":"Plume-org:count-in-db","ref":"count-in-db","sha":"5f97950277627135abb4baff6bbb215af4f17f03","user":{"login":"Plume-org","id":38588078,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NTg4MDc4","avatar_url":"https://avatars1.githubusercontent.com/u/38588078?v=4","gravatar_id":"","url":"https://api.github.com/users/Plume-org","html_url":"https://github.com/Plume-org","followers_url":"https://api.github.com/users/Plume-org/followers","following_url":"https://api.github.com/users/Plume-org/following{/other_user}","gists_url":"https://api.github.com/users/Plume-org/gists{/gist_id}","starred_url":"https://api.github.com/users/Plume-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Plume-org/subscriptions","organizations_url":"https://api.github.com/users/Plume-org/orgs","repos_url":"https://api.github.com/users/Plume-org/repos","events_url":"https://api.github.com/users/Plume-org/events{/privacy}","received_events_url":"https://api.github.com/users/Plume-org/received_events","type":"Organization","site_admin":false},"repo":{"id":130482471,"node_id":"MDEwOlJlcG9zaXRvcnkxMzA0ODI0NzE=","name":"Plume","full_name":"Plume-org/Plume","private":false,"owner":{"login":"Plume-org","id":38588078,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NTg4MDc4","avatar_url":"https://avatars1.githubusercontent.com/u/38588078?v=4","gravatar_id":"","url":"https://api.github.com/users/Plume-org","html_url":"https://github.com/Plume-org","followers_url":"https://api.github.com/users/Plume-org/followers","following_url":"https://api.github.com/users/Plume-org/following{/other_user}","gists_url":"https://api.github.com/users/Plume-org/gists{/gist_id}","starred_url":"https://api.github.com/users/Plume-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Plume-org/subscriptions","organizations_url":"https://api.github.com/users/Plume-org/orgs","repos_url":"https://api.github.com/users/Plume-org/repos","events_url":"https://api.github.com/users/Plume-org/events{/privacy}","received_events_url":"https://api.github.com/users/Plume-org/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Plume-org/Plume","description":"Federated blogging application, thanks to ActivityPub","fork":false,"url":"https://api.github.com/repos/Plume-org/Plume","forks_url":"https://api.github.com/repos/Plume-org/Plume/forks","keys_url":"https://api.github.com/repos/Plume-org/Plume/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Plume-org/Plume/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Plume-org/Plume/teams","hooks_url":"https://api.github.com/repos/Plume-org/Plume/hooks","issue_events_url":"https://api.github.com/repos/Plume-org/Plume/issues/events{/number}","events_url":"https://api.github.com/repos/Plume-org/Plume/events","assignees_url":"https://api.github.com/repos/Plume-org/Plume/assignees{/user}","branches_url":"https://api.github.com/repos/Plume-org/Plume/branches{/branch}","tags_url":"https://api.github.com/repos/Plume-org/Plume/tags","blobs_url":"https://api.github.com/repos/Plume-org/Plume/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Plume-org/Plume/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Plume-org/Plume/git/refs{/sha}","trees_url":"https://api.github.com/repos/Plume-org/Plume/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Plume-org/Plume/statuses/{sha}","languages_url":"https://api.github.com/repos/Plume-org/Plume/languages","stargazers_url":"https://api.github.com/repos/Plume-org/Plume/stargazers","contributors_url":"https://api.github.com/repos/Plume-org/Plume/contributors","subscribers_url":"https://api.github.com/repos/Plume-org/Plume/subscribers","subscription_url":"https://api.github.com/repos/Plume-org/Plume/subscription","commits_url":"https://api.github.com/repos/Plume-org/Plume/commits{/sha}","git_commits_url":"https://api.github.com/repos/Plume-org/Plume/git/commits{/sha}","comments_url":"https://api.github.com/repos/Plume-org/Plume/comments{/number}","issue_comment_url":"https://api.github.com/repos/Plume-org/Plume/issues/comments{/number}","contents_url":"https://api.github.com/repos/Plume-org/Plume/contents/{+path}","compare_url":"https://api.github.com/repos/Plume-org/Plume/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Plume-org/Plume/merges","archive_url":"https://api.github.com/repos/Plume-org/Plume/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Plume-org/Plume/downloads","issues_url":"https://api.github.com/repos/Plume-org/Plume/issues{/number}","pulls_url":"https://api.github.com/repos/Plume-org/Plume/pulls{/number}","milestones_url":"https://api.github.com/repos/Plume-org/Plume/milestones{/number}","notifications_url":"https://api.github.com/repos/Plume-org/Plume/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Plume-org/Plume/labels{/name}","releases_url":"https://api.github.com/repos/Plume-org/Plume/releases{/id}","deployments_url":"https://api.github.com/repos/Plume-org/Plume/deployments","created_at":"2018-04-21T14:42:16Z","updated_at":"2018-12-13T20:57:17Z","pushed_at":"2018-12-13T20:57:15Z","git_url":"git://github.com/Plume-org/Plume.git","ssh_url":"git@github.com:Plume-org/Plume.git","clone_url":"https://github.com/Plume-org/Plume.git","svn_url":"https://github.com/Plume-org/Plume","homepage":"https://joinplu.me","size":7126,"stargazers_count":785,"watchers_count":785,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":53,"mirror_url":null,"archived":false,"open_issues_count":44,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":53,"open_issues":44,"watchers":785,"default_branch":"master"}},"base":{"label":"Plume-org:master","ref":"master","sha":"61b6ceed92ef838a085da6eb66f87ab1de65a520","user":{"login":"Plume-org","id":38588078,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NTg4MDc4","avatar_url":"https://avatars1.githubusercontent.com/u/38588078?v=4","gravatar_id":"","url":"https://api.github.com/users/Plume-org","html_url":"https://github.com/Plume-org","followers_url":"https://api.github.com/users/Plume-org/followers","following_url":"https://api.github.com/users/Plume-org/following{/other_user}","gists_url":"https://api.github.com/users/Plume-org/gists{/gist_id}","starred_url":"https://api.github.com/users/Plume-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Plume-org/subscriptions","organizations_url":"https://api.github.com/users/Plume-org/orgs","repos_url":"https://api.github.com/users/Plume-org/repos","events_url":"https://api.github.com/users/Plume-org/events{/privacy}","received_events_url":"https://api.github.com/users/Plume-org/received_events","type":"Organization","site_admin":false},"repo":{"id":130482471,"node_id":"MDEwOlJlcG9zaXRvcnkxMzA0ODI0NzE=","name":"Plume","full_name":"Plume-org/Plume","private":false,"owner":{"login":"Plume-org","id":38588078,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NTg4MDc4","avatar_url":"https://avatars1.githubusercontent.com/u/38588078?v=4","gravatar_id":"","url":"https://api.github.com/users/Plume-org","html_url":"https://github.com/Plume-org","followers_url":"https://api.github.com/users/Plume-org/followers","following_url":"https://api.github.com/users/Plume-org/following{/other_user}","gists_url":"https://api.github.com/users/Plume-org/gists{/gist_id}","starred_url":"https://api.github.com/users/Plume-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Plume-org/subscriptions","organizations_url":"https://api.github.com/users/Plume-org/orgs","repos_url":"https://api.github.com/users/Plume-org/repos","events_url":"https://api.github.com/users/Plume-org/events{/privacy}","received_events_url":"https://api.github.com/users/Plume-org/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Plume-org/Plume","description":"Federated blogging application, thanks to ActivityPub","fork":false,"url":"https://api.github.com/repos/Plume-org/Plume","forks_url":"https://api.github.com/repos/Plume-org/Plume/forks","keys_url":"https://api.github.com/repos/Plume-org/Plume/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Plume-org/Plume/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Plume-org/Plume/teams","hooks_url":"https://api.github.com/repos/Plume-org/Plume/hooks","issue_events_url":"https://api.github.com/repos/Plume-org/Plume/issues/events{/number}","events_url":"https://api.github.com/repos/Plume-org/Plume/events","assignees_url":"https://api.github.com/repos/Plume-org/Plume/assignees{/user}","branches_url":"https://api.github.com/repos/Plume-org/Plume/branches{/branch}","tags_url":"https://api.github.com/repos/Plume-org/Plume/tags","blobs_url":"https://api.github.com/repos/Plume-org/Plume/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Plume-org/Plume/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Plume-org/Plume/git/refs{/sha}","trees_url":"https://api.github.com/repos/Plume-org/Plume/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Plume-org/Plume/statuses/{sha}","languages_url":"https://api.github.com/repos/Plume-org/Plume/languages","stargazers_url":"https://api.github.com/repos/Plume-org/Plume/stargazers","contributors_url":"https://api.github.com/repos/Plume-org/Plume/contributors","subscribers_url":"https://api.github.com/repos/Plume-org/Plume/subscribers","subscription_url":"https://api.github.com/repos/Plume-org/Plume/subscription","commits_url":"https://api.github.com/repos/Plume-org/Plume/commits{/sha}","git_commits_url":"https://api.github.com/repos/Plume-org/Plume/git/commits{/sha}","comments_url":"https://api.github.com/repos/Plume-org/Plume/comments{/number}","issue_comment_url":"https://api.github.com/repos/Plume-org/Plume/issues/comments{/number}","contents_url":"https://api.github.com/repos/Plume-org/Plume/contents/{+path}","compare_url":"https://api.github.com/repos/Plume-org/Plume/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Plume-org/Plume/merges","archive_url":"https://api.github.com/repos/Plume-org/Plume/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Plume-org/Plume/downloads","issues_url":"https://api.github.com/repos/Plume-org/Plume/issues{/number}","pulls_url":"https://api.github.com/repos/Plume-org/Plume/pulls{/number}","milestones_url":"https://api.github.com/repos/Plume-org/Plume/milestones{/number}","notifications_url":"https://api.github.com/repos/Plume-org/Plume/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Plume-org/Plume/labels{/name}","releases_url":"https://api.github.com/repos/Plume-org/Plume/releases{/id}","deployments_url":"https://api.github.com/repos/Plume-org/Plume/deployments","created_at":"2018-04-21T14:42:16Z","updated_at":"2018-12-13T20:57:17Z","pushed_at":"2018-12-13T20:57:15Z","git_url":"git://github.com/Plume-org/Plume.git","ssh_url":"git@github.com:Plume-org/Plume.git","clone_url":"https://github.com/Plume-org/Plume.git","svn_url":"https://github.com/Plume-org/Plume","homepage":"https://joinplu.me","size":7126,"stargazers_count":785,"watchers_count":785,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":53,"mirror_url":null,"archived":false,"open_issues_count":44,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":53,"open_issues":44,"watchers":785,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Plume-org/Plume/pulls/344"},"html":{"href":"https://github.com/Plume-org/Plume/pull/344"},"issue":{"href":"https://api.github.com/repos/Plume-org/Plume/issues/344"},"comments":{"href":"https://api.github.com/repos/Plume-org/Plume/issues/344/comments"},"review_comments":{"href":"https://api.github.com/repos/Plume-org/Plume/pulls/344/comments"},"review_comment":{"href":"https://api.github.com/repos/Plume-org/Plume/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Plume-org/Plume/pulls/344/commits"},"statuses":{"href":"https://api.github.com/repos/Plume-org/Plume/statuses/5f97950277627135abb4baff6bbb215af4f17f03"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"BaptisteGelez"}}