{"action":"created","comment":{"url":"https://api.github.com/repos/Tahi-project/tahi/pulls/comments/26521490","id":26521490,"diff_hunk":"@@ -163,32 +169,40 @@ def prevent_update_on_locked!\n   end\n \n   def notify_paper_created!\n-    ActivityFeed.create(\n-      feed_name: 'manuscript',\n-      activity_key: 'paper.created',\n-      subject: paper,\n-      user: current_user,\n-      message: 'Paper was created'\n+    Activity.create(","path":"app/controllers/papers_controller.rb","position":41,"original_position":41,"commit_id":"98040b0cd339e55c7cb2f12a72328ff9f6be0510","original_commit_id":"98040b0cd339e55c7cb2f12a72328ff9f6be0510","user":{"login":"surfacedamage","id":18446,"avatar_url":"https://avatars.githubusercontent.com/u/18446?v=3","gravatar_id":"","url":"https://api.github.com/users/surfacedamage","html_url":"https://github.com/surfacedamage","followers_url":"https://api.github.com/users/surfacedamage/followers","following_url":"https://api.github.com/users/surfacedamage/following{/other_user}","gists_url":"https://api.github.com/users/surfacedamage/gists{/gist_id}","starred_url":"https://api.github.com/users/surfacedamage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surfacedamage/subscriptions","organizations_url":"https://api.github.com/users/surfacedamage/orgs","repos_url":"https://api.github.com/users/surfacedamage/repos","events_url":"https://api.github.com/users/surfacedamage/events{/privacy}","received_events_url":"https://api.github.com/users/surfacedamage/received_events","type":"User","site_admin":false},"body":"How about moving this to a controller concern?\r\n```\r\nclass PapersController ...\r\n   include some-mixin-thingy\r\n   \r\n   def update\r\n       broadcast(\"paper:revised\", target: paper) # implicit public true\r\n   end\r\n```\r\n``` \r\n# inside the mixin\r\ndef broadcast (eventname, target:, public: true, actor: current_user)\r\n   Activity.create (....)\r\n   TahiNotifier.notify ....\r\nend\r\n```","created_at":"2015-03-16T19:58:40Z","updated_at":"2015-03-16T19:58:40Z","html_url":"https://github.com/Tahi-project/tahi/pull/905#discussion_r26521490","pull_request_url":"https://api.github.com/repos/Tahi-project/tahi/pulls/905","_links":{"self":{"href":"https://api.github.com/repos/Tahi-project/tahi/pulls/comments/26521490"},"html":{"href":"https://github.com/Tahi-project/tahi/pull/905#discussion_r26521490"},"pull_request":{"href":"https://api.github.com/repos/Tahi-project/tahi/pulls/905"}}},"pull_request":{"url":"https://api.github.com/repos/Tahi-project/tahi/pulls/905","id":31241329,"html_url":"https://github.com/Tahi-project/tahi/pull/905","diff_url":"https://github.com/Tahi-project/tahi/pull/905.diff","patch_url":"https://github.com/Tahi-project/tahi/pull/905.patch","issue_url":"https://api.github.com/repos/Tahi-project/tahi/issues/905","number":905,"state":"open","locked":false,"title":"** SPIKE ** Notifications","user":{"login":"surfacedamage","id":18446,"avatar_url":"https://avatars.githubusercontent.com/u/18446?v=3","gravatar_id":"","url":"https://api.github.com/users/surfacedamage","html_url":"https://github.com/surfacedamage","followers_url":"https://api.github.com/users/surfacedamage/followers","following_url":"https://api.github.com/users/surfacedamage/following{/other_user}","gists_url":"https://api.github.com/users/surfacedamage/gists{/gist_id}","starred_url":"https://api.github.com/users/surfacedamage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surfacedamage/subscriptions","organizations_url":"https://api.github.com/users/surfacedamage/orgs","repos_url":"https://api.github.com/users/surfacedamage/repos","events_url":"https://api.github.com/users/surfacedamage/events{/privacy}","received_events_url":"https://api.github.com/users/surfacedamage/received_events","type":"User","site_admin":false},"body":"## DO NOT MERGE\r\n\r\nThis is a spike to prove out notifications (the handling of triggered events on the client).  This could also allow a pattern for improving the Event Stream by addressing security implications and removing a second source of truth.","created_at":"2015-03-16T13:08:29Z","updated_at":"2015-03-16T19:58:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Tahi-project/tahi/pulls/905/commits","review_comments_url":"https://api.github.com/repos/Tahi-project/tahi/pulls/905/comments","review_comment_url":"https://api.github.com/repos/Tahi-project/tahi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Tahi-project/tahi/issues/905/comments","statuses_url":"https://api.github.com/repos/Tahi-project/tahi/statuses/98040b0cd339e55c7cb2f12a72328ff9f6be0510","head":{"label":"Tahi-project:notifications","ref":"notifications","sha":"98040b0cd339e55c7cb2f12a72328ff9f6be0510","user":{"login":"Tahi-project","id":5808884,"avatar_url":"https://avatars.githubusercontent.com/u/5808884?v=3","gravatar_id":"","url":"https://api.github.com/users/Tahi-project","html_url":"https://github.com/Tahi-project","followers_url":"https://api.github.com/users/Tahi-project/followers","following_url":"https://api.github.com/users/Tahi-project/following{/other_user}","gists_url":"https://api.github.com/users/Tahi-project/gists{/gist_id}","starred_url":"https://api.github.com/users/Tahi-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tahi-project/subscriptions","organizations_url":"https://api.github.com/users/Tahi-project/orgs","repos_url":"https://api.github.com/users/Tahi-project/repos","events_url":"https://api.github.com/users/Tahi-project/events{/privacy}","received_events_url":"https://api.github.com/users/Tahi-project/received_events","type":"Organization","site_admin":false},"repo":{"id":13939437,"name":"tahi","full_name":"Tahi-project/tahi","owner":{"login":"Tahi-project","id":5808884,"avatar_url":"https://avatars.githubusercontent.com/u/5808884?v=3","gravatar_id":"","url":"https://api.github.com/users/Tahi-project","html_url":"https://github.com/Tahi-project","followers_url":"https://api.github.com/users/Tahi-project/followers","following_url":"https://api.github.com/users/Tahi-project/following{/other_user}","gists_url":"https://api.github.com/users/Tahi-project/gists{/gist_id}","starred_url":"https://api.github.com/users/Tahi-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tahi-project/subscriptions","organizations_url":"https://api.github.com/users/Tahi-project/orgs","repos_url":"https://api.github.com/users/Tahi-project/repos","events_url":"https://api.github.com/users/Tahi-project/events{/privacy}","received_events_url":"https://api.github.com/users/Tahi-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tahi-project/tahi","description":"Modern workflow platform","fork":false,"url":"https://api.github.com/repos/Tahi-project/tahi","forks_url":"https://api.github.com/repos/Tahi-project/tahi/forks","keys_url":"https://api.github.com/repos/Tahi-project/tahi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tahi-project/tahi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tahi-project/tahi/teams","hooks_url":"https://api.github.com/repos/Tahi-project/tahi/hooks","issue_events_url":"https://api.github.com/repos/Tahi-project/tahi/issues/events{/number}","events_url":"https://api.github.com/repos/Tahi-project/tahi/events","assignees_url":"https://api.github.com/repos/Tahi-project/tahi/assignees{/user}","branches_url":"https://api.github.com/repos/Tahi-project/tahi/branches{/branch}","tags_url":"https://api.github.com/repos/Tahi-project/tahi/tags","blobs_url":"https://api.github.com/repos/Tahi-project/tahi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tahi-project/tahi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tahi-project/tahi/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tahi-project/tahi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tahi-project/tahi/statuses/{sha}","languages_url":"https://api.github.com/repos/Tahi-project/tahi/languages","stargazers_url":"https://api.github.com/repos/Tahi-project/tahi/stargazers","contributors_url":"https://api.github.com/repos/Tahi-project/tahi/contributors","subscribers_url":"https://api.github.com/repos/Tahi-project/tahi/subscribers","subscription_url":"https://api.github.com/repos/Tahi-project/tahi/subscription","commits_url":"https://api.github.com/repos/Tahi-project/tahi/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tahi-project/tahi/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tahi-project/tahi/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tahi-project/tahi/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tahi-project/tahi/contents/{+path}","compare_url":"https://api.github.com/repos/Tahi-project/tahi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tahi-project/tahi/merges","archive_url":"https://api.github.com/repos/Tahi-project/tahi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tahi-project/tahi/downloads","issues_url":"https://api.github.com/repos/Tahi-project/tahi/issues{/number}","pulls_url":"https://api.github.com/repos/Tahi-project/tahi/pulls{/number}","milestones_url":"https://api.github.com/repos/Tahi-project/tahi/milestones{/number}","notifications_url":"https://api.github.com/repos/Tahi-project/tahi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tahi-project/tahi/labels{/name}","releases_url":"https://api.github.com/repos/Tahi-project/tahi/releases{/id}","created_at":"2013-10-28T21:42:53Z","updated_at":"2015-03-16T18:06:05Z","pushed_at":"2015-03-16T18:06:02Z","git_url":"git://github.com/Tahi-project/tahi.git","ssh_url":"git@github.com:Tahi-project/tahi.git","clone_url":"https://github.com/Tahi-project/tahi.git","svn_url":"https://github.com/Tahi-project/tahi","homepage":"","size":149133,"stargazers_count":17,"watchers_count":17,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":19,"forks":7,"open_issues":19,"watchers":17,"default_branch":"master"}},"base":{"label":"Tahi-project:master","ref":"master","sha":"bec4a244f75d661c7211cbd0c5f8229d7b81ec71","user":{"login":"Tahi-project","id":5808884,"avatar_url":"https://avatars.githubusercontent.com/u/5808884?v=3","gravatar_id":"","url":"https://api.github.com/users/Tahi-project","html_url":"https://github.com/Tahi-project","followers_url":"https://api.github.com/users/Tahi-project/followers","following_url":"https://api.github.com/users/Tahi-project/following{/other_user}","gists_url":"https://api.github.com/users/Tahi-project/gists{/gist_id}","starred_url":"https://api.github.com/users/Tahi-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tahi-project/subscriptions","organizations_url":"https://api.github.com/users/Tahi-project/orgs","repos_url":"https://api.github.com/users/Tahi-project/repos","events_url":"https://api.github.com/users/Tahi-project/events{/privacy}","received_events_url":"https://api.github.com/users/Tahi-project/received_events","type":"Organization","site_admin":false},"repo":{"id":13939437,"name":"tahi","full_name":"Tahi-project/tahi","owner":{"login":"Tahi-project","id":5808884,"avatar_url":"https://avatars.githubusercontent.com/u/5808884?v=3","gravatar_id":"","url":"https://api.github.com/users/Tahi-project","html_url":"https://github.com/Tahi-project","followers_url":"https://api.github.com/users/Tahi-project/followers","following_url":"https://api.github.com/users/Tahi-project/following{/other_user}","gists_url":"https://api.github.com/users/Tahi-project/gists{/gist_id}","starred_url":"https://api.github.com/users/Tahi-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tahi-project/subscriptions","organizations_url":"https://api.github.com/users/Tahi-project/orgs","repos_url":"https://api.github.com/users/Tahi-project/repos","events_url":"https://api.github.com/users/Tahi-project/events{/privacy}","received_events_url":"https://api.github.com/users/Tahi-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tahi-project/tahi","description":"Modern workflow platform","fork":false,"url":"https://api.github.com/repos/Tahi-project/tahi","forks_url":"https://api.github.com/repos/Tahi-project/tahi/forks","keys_url":"https://api.github.com/repos/Tahi-project/tahi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tahi-project/tahi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tahi-project/tahi/teams","hooks_url":"https://api.github.com/repos/Tahi-project/tahi/hooks","issue_events_url":"https://api.github.com/repos/Tahi-project/tahi/issues/events{/number}","events_url":"https://api.github.com/repos/Tahi-project/tahi/events","assignees_url":"https://api.github.com/repos/Tahi-project/tahi/assignees{/user}","branches_url":"https://api.github.com/repos/Tahi-project/tahi/branches{/branch}","tags_url":"https://api.github.com/repos/Tahi-project/tahi/tags","blobs_url":"https://api.github.com/repos/Tahi-project/tahi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tahi-project/tahi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tahi-project/tahi/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tahi-project/tahi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tahi-project/tahi/statuses/{sha}","languages_url":"https://api.github.com/repos/Tahi-project/tahi/languages","stargazers_url":"https://api.github.com/repos/Tahi-project/tahi/stargazers","contributors_url":"https://api.github.com/repos/Tahi-project/tahi/contributors","subscribers_url":"https://api.github.com/repos/Tahi-project/tahi/subscribers","subscription_url":"https://api.github.com/repos/Tahi-project/tahi/subscription","commits_url":"https://api.github.com/repos/Tahi-project/tahi/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tahi-project/tahi/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tahi-project/tahi/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tahi-project/tahi/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tahi-project/tahi/contents/{+path}","compare_url":"https://api.github.com/repos/Tahi-project/tahi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tahi-project/tahi/merges","archive_url":"https://api.github.com/repos/Tahi-project/tahi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tahi-project/tahi/downloads","issues_url":"https://api.github.com/repos/Tahi-project/tahi/issues{/number}","pulls_url":"https://api.github.com/repos/Tahi-project/tahi/pulls{/number}","milestones_url":"https://api.github.com/repos/Tahi-project/tahi/milestones{/number}","notifications_url":"https://api.github.com/repos/Tahi-project/tahi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tahi-project/tahi/labels{/name}","releases_url":"https://api.github.com/repos/Tahi-project/tahi/releases{/id}","created_at":"2013-10-28T21:42:53Z","updated_at":"2015-03-16T18:06:05Z","pushed_at":"2015-03-16T18:06:02Z","git_url":"git://github.com/Tahi-project/tahi.git","ssh_url":"git@github.com:Tahi-project/tahi.git","clone_url":"https://github.com/Tahi-project/tahi.git","svn_url":"https://github.com/Tahi-project/tahi","homepage":"","size":149133,"stargazers_count":17,"watchers_count":17,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":19,"forks":7,"open_issues":19,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Tahi-project/tahi/pulls/905"},"html":{"href":"https://github.com/Tahi-project/tahi/pull/905"},"issue":{"href":"https://api.github.com/repos/Tahi-project/tahi/issues/905"},"comments":{"href":"https://api.github.com/repos/Tahi-project/tahi/issues/905/comments"},"review_comments":{"href":"https://api.github.com/repos/Tahi-project/tahi/pulls/905/comments"},"review_comment":{"href":"https://api.github.com/repos/Tahi-project/tahi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Tahi-project/tahi/pulls/905/commits"},"statuses":{"href":"https://api.github.com/repos/Tahi-project/tahi/statuses/98040b0cd339e55c7cb2f12a72328ff9f6be0510"}}}}