{"action":"created","comment":{"url":"https://api.github.com/repos/Codeminer42/cm42-central/pulls/comments/76879338","id":76879338,"diff_hunk":"@@ -37,10 +37,22 @@ def noun\n   def update_changes\n     return \"\" unless action == 'update'\n     changes = subject_changes.keys.reject { |key| %w(updated_at created_at).include?(key) }.map do |key|\n-      if subject_changes[key].first.nil?\n-        \"#{key} to '#{subject_changes[key].last}' \"\n+      if key == 'documents_attributes'\n+        old_documents     = subject_changes[key].first || []\n+        new_documents     = subject_changes[key].last  || []\n+        added_documents   = new_documents - old_documents\n+        deleted_documents = old_documents - new_documents\n+\n+        tmp_changes = []\n+        tmp_changes << \"by uploading '#{added_documents.join(\"', '\")}'\"  if added_documents.size   > 0\n+        tmp_changes << \"by deleting '#{deleted_documents.join(\"', '\")}'\" if deleted_documents.size > 0\n+        \"documents \" + tmp_changes.join(\" and \")","path":"app/presenters/activity_presenter.rb","position":15,"original_position":15,"commit_id":"69904e7a695e33beeaf0efe62782a0089ad5bc86","original_commit_id":"69904e7a695e33beeaf0efe62782a0089ad5bc86","user":{"login":"adbatista","id":485381,"avatar_url":"https://avatars.githubusercontent.com/u/485381?v=3","gravatar_id":"","url":"https://api.github.com/users/adbatista","html_url":"https://github.com/adbatista","followers_url":"https://api.github.com/users/adbatista/followers","following_url":"https://api.github.com/users/adbatista/following{/other_user}","gists_url":"https://api.github.com/users/adbatista/gists{/gist_id}","starred_url":"https://api.github.com/users/adbatista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adbatista/subscriptions","organizations_url":"https://api.github.com/users/adbatista/orgs","repos_url":"https://api.github.com/users/adbatista/repos","events_url":"https://api.github.com/users/adbatista/events{/privacy}","received_events_url":"https://api.github.com/users/adbatista/received_events","type":"User","site_admin":false},"body":"should be nice move the documents part into separated method ","created_at":"2016-08-30T21:08:22Z","updated_at":"2016-08-30T21:08:22Z","html_url":"https://github.com/Codeminer42/cm42-central/pull/20#discussion_r76879338","pull_request_url":"https://api.github.com/repos/Codeminer42/cm42-central/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/Codeminer42/cm42-central/pulls/comments/76879338"},"html":{"href":"https://github.com/Codeminer42/cm42-central/pull/20#discussion_r76879338"},"pull_request":{"href":"https://api.github.com/repos/Codeminer42/cm42-central/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/Codeminer42/cm42-central/pulls/20","id":83346418,"html_url":"https://github.com/Codeminer42/cm42-central/pull/20","diff_url":"https://github.com/Codeminer42/cm42-central/pull/20.diff","patch_url":"https://github.com/Codeminer42/cm42-central/pull/20.patch","issue_url":"https://api.github.com/repos/Codeminer42/cm42-central/issues/20","number":20,"state":"open","locked":false,"title":"Tracking attachinary documents changes","user":{"login":"akitaonrails","id":2840,"avatar_url":"https://avatars.githubusercontent.com/u/2840?v=3","gravatar_id":"","url":"https://api.github.com/users/akitaonrails","html_url":"https://github.com/akitaonrails","followers_url":"https://api.github.com/users/akitaonrails/followers","following_url":"https://api.github.com/users/akitaonrails/following{/other_user}","gists_url":"https://api.github.com/users/akitaonrails/gists{/gist_id}","starred_url":"https://api.github.com/users/akitaonrails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akitaonrails/subscriptions","organizations_url":"https://api.github.com/users/akitaonrails/orgs","repos_url":"https://api.github.com/users/akitaonrails/repos","events_url":"https://api.github.com/users/akitaonrails/events{/privacy}","received_events_url":"https://api.github.com/users/akitaonrails/received_events","type":"User","site_admin":false},"body":"And properly presenting the changes in the activity feed.\r\n\r\n![screen shot 2016-08-30 at 17 59 55](https://cloud.githubusercontent.com/assets/2840/18106828/aa3708a2-6edb-11e6-9cd3-c81d811b451a.png)\r\n","created_at":"2016-08-30T21:00:44Z","updated_at":"2016-08-30T21:08:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df90bfca228375aa4431a60eec6735db343e2529","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Codeminer42/cm42-central/pulls/20/commits","review_comments_url":"https://api.github.com/repos/Codeminer42/cm42-central/pulls/20/comments","review_comment_url":"https://api.github.com/repos/Codeminer42/cm42-central/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Codeminer42/cm42-central/issues/20/comments","statuses_url":"https://api.github.com/repos/Codeminer42/cm42-central/statuses/69904e7a695e33beeaf0efe62782a0089ad5bc86","head":{"label":"Codeminer42:attachments_activity","ref":"attachments_activity","sha":"69904e7a695e33beeaf0efe62782a0089ad5bc86","user":{"login":"Codeminer42","id":1602924,"avatar_url":"https://avatars.githubusercontent.com/u/1602924?v=3","gravatar_id":"","url":"https://api.github.com/users/Codeminer42","html_url":"https://github.com/Codeminer42","followers_url":"https://api.github.com/users/Codeminer42/followers","following_url":"https://api.github.com/users/Codeminer42/following{/other_user}","gists_url":"https://api.github.com/users/Codeminer42/gists{/gist_id}","starred_url":"https://api.github.com/users/Codeminer42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Codeminer42/subscriptions","organizations_url":"https://api.github.com/users/Codeminer42/orgs","repos_url":"https://api.github.com/users/Codeminer42/repos","events_url":"https://api.github.com/users/Codeminer42/events{/privacy}","received_events_url":"https://api.github.com/users/Codeminer42/received_events","type":"Organization","site_admin":false},"repo":{"id":65383435,"name":"cm42-central","full_name":"Codeminer42/cm42-central","owner":{"login":"Codeminer42","id":1602924,"avatar_url":"https://avatars.githubusercontent.com/u/1602924?v=3","gravatar_id":"","url":"https://api.github.com/users/Codeminer42","html_url":"https://github.com/Codeminer42","followers_url":"https://api.github.com/users/Codeminer42/followers","following_url":"https://api.github.com/users/Codeminer42/following{/other_user}","gists_url":"https://api.github.com/users/Codeminer42/gists{/gist_id}","starred_url":"https://api.github.com/users/Codeminer42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Codeminer42/subscriptions","organizations_url":"https://api.github.com/users/Codeminer42/orgs","repos_url":"https://api.github.com/users/Codeminer42/repos","events_url":"https://api.github.com/users/Codeminer42/events{/privacy}","received_events_url":"https://api.github.com/users/Codeminer42/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Codeminer42/cm42-central","description":"Fork of the Fulcrum project - An agile project planning tool","fork":true,"url":"https://api.github.com/repos/Codeminer42/cm42-central","forks_url":"https://api.github.com/repos/Codeminer42/cm42-central/forks","keys_url":"https://api.github.com/repos/Codeminer42/cm42-central/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Codeminer42/cm42-central/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Codeminer42/cm42-central/teams","hooks_url":"https://api.github.com/repos/Codeminer42/cm42-central/hooks","issue_events_url":"https://api.github.com/repos/Codeminer42/cm42-central/issues/events{/number}","events_url":"https://api.github.com/repos/Codeminer42/cm42-central/events","assignees_url":"https://api.github.com/repos/Codeminer42/cm42-central/assignees{/user}","branches_url":"https://api.github.com/repos/Codeminer42/cm42-central/branches{/branch}","tags_url":"https://api.github.com/repos/Codeminer42/cm42-central/tags","blobs_url":"https://api.github.com/repos/Codeminer42/cm42-central/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Codeminer42/cm42-central/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Codeminer42/cm42-central/git/refs{/sha}","trees_url":"https://api.github.com/repos/Codeminer42/cm42-central/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Codeminer42/cm42-central/statuses/{sha}","languages_url":"https://api.github.com/repos/Codeminer42/cm42-central/languages","stargazers_url":"https://api.github.com/repos/Codeminer42/cm42-central/stargazers","contributors_url":"https://api.github.com/repos/Codeminer42/cm42-central/contributors","subscribers_url":"https://api.github.com/repos/Codeminer42/cm42-central/subscribers","subscription_url":"https://api.github.com/repos/Codeminer42/cm42-central/subscription","commits_url":"https://api.github.com/repos/Codeminer42/cm42-central/commits{/sha}","git_commits_url":"https://api.github.com/repos/Codeminer42/cm42-central/git/commits{/sha}","comments_url":"https://api.github.com/repos/Codeminer42/cm42-central/comments{/number}","issue_comment_url":"https://api.github.com/repos/Codeminer42/cm42-central/issues/comments{/number}","contents_url":"https://api.github.com/repos/Codeminer42/cm42-central/contents/{+path}","compare_url":"https://api.github.com/repos/Codeminer42/cm42-central/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Codeminer42/cm42-central/merges","archive_url":"https://api.github.com/repos/Codeminer42/cm42-central/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Codeminer42/cm42-central/downloads","issues_url":"https://api.github.com/repos/Codeminer42/cm42-central/issues{/number}","pulls_url":"https://api.github.com/repos/Codeminer42/cm42-central/pulls{/number}","milestones_url":"https://api.github.com/repos/Codeminer42/cm42-central/milestones{/number}","notifications_url":"https://api.github.com/repos/Codeminer42/cm42-central/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Codeminer42/cm42-central/labels{/name}","releases_url":"https://api.github.com/repos/Codeminer42/cm42-central/releases{/id}","deployments_url":"https://api.github.com/repos/Codeminer42/cm42-central/deployments","created_at":"2016-08-10T13:09:14Z","updated_at":"2016-08-30T01:51:48Z","pushed_at":"2016-08-30T21:00:44Z","git_url":"git://github.com/Codeminer42/cm42-central.git","ssh_url":"git@github.com:Codeminer42/cm42-central.git","clone_url":"https://github.com/Codeminer42/cm42-central.git","svn_url":"https://github.com/Codeminer42/cm42-central","homepage":"http://wholemeal.co.nz/projects/fulcrum.html","size":3642,"stargazers_count":20,"watchers_count":20,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":20,"default_branch":"master"}},"base":{"label":"Codeminer42:master","ref":"master","sha":"63deba1039a40398ae292b2e4d455fdd7238cfe9","user":{"login":"Codeminer42","id":1602924,"avatar_url":"https://avatars.githubusercontent.com/u/1602924?v=3","gravatar_id":"","url":"https://api.github.com/users/Codeminer42","html_url":"https://github.com/Codeminer42","followers_url":"https://api.github.com/users/Codeminer42/followers","following_url":"https://api.github.com/users/Codeminer42/following{/other_user}","gists_url":"https://api.github.com/users/Codeminer42/gists{/gist_id}","starred_url":"https://api.github.com/users/Codeminer42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Codeminer42/subscriptions","organizations_url":"https://api.github.com/users/Codeminer42/orgs","repos_url":"https://api.github.com/users/Codeminer42/repos","events_url":"https://api.github.com/users/Codeminer42/events{/privacy}","received_events_url":"https://api.github.com/users/Codeminer42/received_events","type":"Organization","site_admin":false},"repo":{"id":65383435,"name":"cm42-central","full_name":"Codeminer42/cm42-central","owner":{"login":"Codeminer42","id":1602924,"avatar_url":"https://avatars.githubusercontent.com/u/1602924?v=3","gravatar_id":"","url":"https://api.github.com/users/Codeminer42","html_url":"https://github.com/Codeminer42","followers_url":"https://api.github.com/users/Codeminer42/followers","following_url":"https://api.github.com/users/Codeminer42/following{/other_user}","gists_url":"https://api.github.com/users/Codeminer42/gists{/gist_id}","starred_url":"https://api.github.com/users/Codeminer42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Codeminer42/subscriptions","organizations_url":"https://api.github.com/users/Codeminer42/orgs","repos_url":"https://api.github.com/users/Codeminer42/repos","events_url":"https://api.github.com/users/Codeminer42/events{/privacy}","received_events_url":"https://api.github.com/users/Codeminer42/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Codeminer42/cm42-central","description":"Fork of the Fulcrum project - An agile project planning tool","fork":true,"url":"https://api.github.com/repos/Codeminer42/cm42-central","forks_url":"https://api.github.com/repos/Codeminer42/cm42-central/forks","keys_url":"https://api.github.com/repos/Codeminer42/cm42-central/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Codeminer42/cm42-central/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Codeminer42/cm42-central/teams","hooks_url":"https://api.github.com/repos/Codeminer42/cm42-central/hooks","issue_events_url":"https://api.github.com/repos/Codeminer42/cm42-central/issues/events{/number}","events_url":"https://api.github.com/repos/Codeminer42/cm42-central/events","assignees_url":"https://api.github.com/repos/Codeminer42/cm42-central/assignees{/user}","branches_url":"https://api.github.com/repos/Codeminer42/cm42-central/branches{/branch}","tags_url":"https://api.github.com/repos/Codeminer42/cm42-central/tags","blobs_url":"https://api.github.com/repos/Codeminer42/cm42-central/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Codeminer42/cm42-central/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Codeminer42/cm42-central/git/refs{/sha}","trees_url":"https://api.github.com/repos/Codeminer42/cm42-central/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Codeminer42/cm42-central/statuses/{sha}","languages_url":"https://api.github.com/repos/Codeminer42/cm42-central/languages","stargazers_url":"https://api.github.com/repos/Codeminer42/cm42-central/stargazers","contributors_url":"https://api.github.com/repos/Codeminer42/cm42-central/contributors","subscribers_url":"https://api.github.com/repos/Codeminer42/cm42-central/subscribers","subscription_url":"https://api.github.com/repos/Codeminer42/cm42-central/subscription","commits_url":"https://api.github.com/repos/Codeminer42/cm42-central/commits{/sha}","git_commits_url":"https://api.github.com/repos/Codeminer42/cm42-central/git/commits{/sha}","comments_url":"https://api.github.com/repos/Codeminer42/cm42-central/comments{/number}","issue_comment_url":"https://api.github.com/repos/Codeminer42/cm42-central/issues/comments{/number}","contents_url":"https://api.github.com/repos/Codeminer42/cm42-central/contents/{+path}","compare_url":"https://api.github.com/repos/Codeminer42/cm42-central/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Codeminer42/cm42-central/merges","archive_url":"https://api.github.com/repos/Codeminer42/cm42-central/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Codeminer42/cm42-central/downloads","issues_url":"https://api.github.com/repos/Codeminer42/cm42-central/issues{/number}","pulls_url":"https://api.github.com/repos/Codeminer42/cm42-central/pulls{/number}","milestones_url":"https://api.github.com/repos/Codeminer42/cm42-central/milestones{/number}","notifications_url":"https://api.github.com/repos/Codeminer42/cm42-central/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Codeminer42/cm42-central/labels{/name}","releases_url":"https://api.github.com/repos/Codeminer42/cm42-central/releases{/id}","deployments_url":"https://api.github.com/repos/Codeminer42/cm42-central/deployments","created_at":"2016-08-10T13:09:14Z","updated_at":"2016-08-30T01:51:48Z","pushed_at":"2016-08-30T21:00:44Z","git_url":"git://github.com/Codeminer42/cm42-central.git","ssh_url":"git@github.com:Codeminer42/cm42-central.git","clone_url":"https://github.com/Codeminer42/cm42-central.git","svn_url":"https://github.com/Codeminer42/cm42-central","homepage":"http://wholemeal.co.nz/projects/fulcrum.html","size":3642,"stargazers_count":20,"watchers_count":20,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Codeminer42/cm42-central/pulls/20"},"html":{"href":"https://github.com/Codeminer42/cm42-central/pull/20"},"issue":{"href":"https://api.github.com/repos/Codeminer42/cm42-central/issues/20"},"comments":{"href":"https://api.github.com/repos/Codeminer42/cm42-central/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/Codeminer42/cm42-central/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/Codeminer42/cm42-central/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Codeminer42/cm42-central/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/Codeminer42/cm42-central/statuses/69904e7a695e33beeaf0efe62782a0089ad5bc86"}}}}
{"actor":{"display_login":"adbatista"}}