GitHub PullRequestReviewCommentEvent at 2014-10-24 11:04:51
Repository: cms
Actor: stevenwilkin
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/moneyadviceservice/cms/pulls/comments/19333287","id":19333287,"diff_hunk":"@@ -46,14 +54,29 @@ def keywords_attributes=(new_keyword_ids)\n \n     private\n \n-      def keyword!(keyword_ids:)\n-        keyword_ids.each {|id| taggings.create(tag_id: id)}\n-      end\n+    # Associates a tag to this item.\n+    def keyword!(keyword_ids:)\n+      action = is_mirrored_with_taggings ? :build : :create\n+      keyword_ids.each {|id| taggings.send(action, tag_id: id)}\n+    end\n \n-      def unkeyword!(keyword_ids:)\n-        taggings.where(tag_id: keyword_ids).each(&:destroy)\n+    # Disassociates a tag to this item.\n+    def unkeyword!(keyword_ids:)\n+      taggings.where(tag_id: keyword_ids).each(&:destroy)\n+    end\n+\n+    # Callbacks\n+\n+    # Synchorize the taggings of this item with the ones in its mirrors. So all of them\n+    # are associated to the same tags\n+    def sync_mirrors_with_taggings\n+      if is_mirrored_with_taggings\n+        mirrors.each {|mirror| mirror.assign_new_keywords!(new_keyword_ids: keywords.map(&:id))}\n       end\n+    end\n+\n   end\n end\n \n ActiveRecord::Base.send(:include, ComfortableMexicanSofa::IsTaggable)\n+","path":"lib/comfortable_mexican_sofa/extensions/is_taggable.rb","position":80,"original_position":80,"commit_id":"dff768f6b5ce717f3cdba648557fd9d8858609bc","original_commit_id":"dff768f6b5ce717f3cdba648557fd9d8858609bc","user":{"login":"stevenwilkin","id":45121,"avatar_url":"https://avatars.githubusercontent.com/u/45121?v=2","gravatar_id":"","url":"https://api.github.com/users/stevenwilkin","html_url":"https://github.com/stevenwilkin","followers_url":"https://api.github.com/users/stevenwilkin/followers","following_url":"https://api.github.com/users/stevenwilkin/following{/other_user}","gists_url":"https://api.github.com/users/stevenwilkin/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenwilkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenwilkin/subscriptions","organizations_url":"https://api.github.com/users/stevenwilkin/orgs","repos_url":"https://api.github.com/users/stevenwilkin/repos","events_url":"https://api.github.com/users/stevenwilkin/events{/privacy}","received_events_url":"https://api.github.com/users/stevenwilkin/received_events","type":"User","site_admin":false},"body":"Unneeded empty line","created_at":"2014-10-24T11:04:51Z","updated_at":"2014-10-24T11:04:51Z","html_url":"https://github.com/moneyadviceservice/cms/pull/49#discussion_r19333287","pull_request_url":"https://api.github.com/repos/moneyadviceservice/cms/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/moneyadviceservice/cms/pulls/comments/19333287"},"html":{"href":"https://github.com/moneyadviceservice/cms/pull/49#discussion_r19333287"},"pull_request":{"href":"https://api.github.com/repos/moneyadviceservice/cms/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/moneyadviceservice/cms/pulls/49","id":23288660,"html_url":"https://github.com/moneyadviceservice/cms/pull/49","diff_url":"https://github.com/moneyadviceservice/cms/pull/49.diff","patch_url":"https://github.com/moneyadviceservice/cms/pull/49.patch","issue_url":"https://api.github.com/repos/moneyadviceservice/cms/issues/49","number":49,"state":"open","locked":false,"title":"Tagging Fixes","user":{"login":"lorenzotello","id":8899941,"avatar_url":"https://avatars.githubusercontent.com/u/8899941?v=2","gravatar_id":"","url":"https://api.github.com/users/lorenzotello","html_url":"https://github.com/lorenzotello","followers_url":"https://api.github.com/users/lorenzotello/followers","following_url":"https://api.github.com/users/lorenzotello/following{/other_user}","gists_url":"https://api.github.com/users/lorenzotello/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzotello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzotello/subscriptions","organizations_url":"https://api.github.com/users/lorenzotello/orgs","repos_url":"https://api.github.com/users/lorenzotello/repos","events_url":"https://api.github.com/users/lorenzotello/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzotello/received_events","type":"User","site_admin":false},"body":"Fixes bugs:\r\n  - enable new page with associated tags creation.\r\n  - associate tags to mirror pages","created_at":"2014-10-24T10:44:30Z","updated_at":"2014-10-24T11:04:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ebcf6362e13fbafc3a0e03dbe21f09415e5bee07","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/moneyadviceservice/cms/pulls/49/commits","review_comments_url":"https://api.github.com/repos/moneyadviceservice/cms/pulls/49/comments","review_comment_url":"https://api.github.com/repos/moneyadviceservice/cms/pulls/comments/{number}","comments_url":"https://api.github.com/repos/moneyadviceservice/cms/issues/49/comments","statuses_url":"https://api.github.com/repos/moneyadviceservice/cms/statuses/dff768f6b5ce717f3cdba648557fd9d8858609bc","head":{"label":"moneyadviceservice:tagging","ref":"tagging","sha":"dff768f6b5ce717f3cdba648557fd9d8858609bc","user":{"login":"moneyadviceservice","id":2064781,"avatar_url":"https://avatars.githubusercontent.com/u/2064781?v=2","gravatar_id":"","url":"https://api.github.com/users/moneyadviceservice","html_url":"https://github.com/moneyadviceservice","followers_url":"https://api.github.com/users/moneyadviceservice/followers","following_url":"https://api.github.com/users/moneyadviceservice/following{/other_user}","gists_url":"https://api.github.com/users/moneyadviceservice/gists{/gist_id}","starred_url":"https://api.github.com/users/moneyadviceservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneyadviceservice/subscriptions","organizations_url":"https://api.github.com/users/moneyadviceservice/orgs","repos_url":"https://api.github.com/users/moneyadviceservice/repos","events_url":"https://api.github.com/users/moneyadviceservice/events{/privacy}","received_events_url":"https://api.github.com/users/moneyadviceservice/received_events","type":"Organization","site_admin":false},"repo":{"id":21238354,"name":"cms","full_name":"moneyadviceservice/cms","owner":{"login":"moneyadviceservice","id":2064781,"avatar_url":"https://avatars.githubusercontent.com/u/2064781?v=2","gravatar_id":"","url":"https://api.github.com/users/moneyadviceservice","html_url":"https://github.com/moneyadviceservice","followers_url":"https://api.github.com/users/moneyadviceservice/followers","following_url":"https://api.github.com/users/moneyadviceservice/following{/other_user}","gists_url":"https://api.github.com/users/moneyadviceservice/gists{/gist_id}","starred_url":"https://api.github.com/users/moneyadviceservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneyadviceservice/subscriptions","organizations_url":"https://api.github.com/users/moneyadviceservice/orgs","repos_url":"https://api.github.com/users/moneyadviceservice/repos","events_url":"https://api.github.com/users/moneyadviceservice/events{/privacy}","received_events_url":"https://api.github.com/users/moneyadviceservice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moneyadviceservice/cms","description":"The MAS CMS","fork":false,"url":"https://api.github.com/repos/moneyadviceservice/cms","forks_url":"https://api.github.com/repos/moneyadviceservice/cms/forks","keys_url":"https://api.github.com/repos/moneyadviceservice/cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moneyadviceservice/cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moneyadviceservice/cms/teams","hooks_url":"https://api.github.com/repos/moneyadviceservice/cms/hooks","issue_events_url":"https://api.github.com/repos/moneyadviceservice/cms/issues/events{/number}","events_url":"https://api.github.com/repos/moneyadviceservice/cms/events","assignees_url":"https://api.github.com/repos/moneyadviceservice/cms/assignees{/user}","branches_url":"https://api.github.com/repos/moneyadviceservice/cms/branches{/branch}","tags_url":"https://api.github.com/repos/moneyadviceservice/cms/tags","blobs_url":"https://api.github.com/repos/moneyadviceservice/cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moneyadviceservice/cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moneyadviceservice/cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/moneyadviceservice/cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moneyadviceservice/cms/statuses/{sha}","languages_url":"https://api.github.com/repos/moneyadviceservice/cms/languages","stargazers_url":"https://api.github.com/repos/moneyadviceservice/cms/stargazers","contributors_url":"https://api.github.com/repos/moneyadviceservice/cms/contributors","subscribers_url":"https://api.github.com/repos/moneyadviceservice/cms/subscribers","subscription_url":"https://api.github.com/repos/moneyadviceservice/cms/subscription","commits_url":"https://api.github.com/repos/moneyadviceservice/cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/moneyadviceservice/cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/moneyadviceservice/cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/moneyadviceservice/cms/issues/comments/{number}","contents_url":"https://api.github.com/repos/moneyadviceservice/cms/contents/{+path}","compare_url":"https://api.github.com/repos/moneyadviceservice/cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moneyadviceservice/cms/merges","archive_url":"https://api.github.com/repos/moneyadviceservice/cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moneyadviceservice/cms/downloads","issues_url":"https://api.github.com/repos/moneyadviceservice/cms/issues{/number}","pulls_url":"https://api.github.com/repos/moneyadviceservice/cms/pulls{/number}","milestones_url":"https://api.github.com/repos/moneyadviceservice/cms/milestones{/number}","notifications_url":"https://api.github.com/repos/moneyadviceservice/cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moneyadviceservice/cms/labels{/name}","releases_url":"https://api.github.com/repos/moneyadviceservice/cms/releases{/id}","created_at":"2014-06-26T11:26:25Z","updated_at":"2014-09-08T10:29:15Z","pushed_at":"2014-10-24T10:43:58Z","git_url":"git://github.com/moneyadviceservice/cms.git","ssh_url":"git@github.com:moneyadviceservice/cms.git","clone_url":"https://github.com/moneyadviceservice/cms.git","svn_url":"https://github.com/moneyadviceservice/cms","homepage":null,"size":6104,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"moneyadviceservice:master","ref":"master","sha":"83c694175924ad37d50431566c2435954bacf4e3","user":{"login":"moneyadviceservice","id":2064781,"avatar_url":"https://avatars.githubusercontent.com/u/2064781?v=2","gravatar_id":"","url":"https://api.github.com/users/moneyadviceservice","html_url":"https://github.com/moneyadviceservice","followers_url":"https://api.github.com/users/moneyadviceservice/followers","following_url":"https://api.github.com/users/moneyadviceservice/following{/other_user}","gists_url":"https://api.github.com/users/moneyadviceservice/gists{/gist_id}","starred_url":"https://api.github.com/users/moneyadviceservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneyadviceservice/subscriptions","organizations_url":"https://api.github.com/users/moneyadviceservice/orgs","repos_url":"https://api.github.com/users/moneyadviceservice/repos","events_url":"https://api.github.com/users/moneyadviceservice/events{/privacy}","received_events_url":"https://api.github.com/users/moneyadviceservice/received_events","type":"Organization","site_admin":false},"repo":{"id":21238354,"name":"cms","full_name":"moneyadviceservice/cms","owner":{"login":"moneyadviceservice","id":2064781,"avatar_url":"https://avatars.githubusercontent.com/u/2064781?v=2","gravatar_id":"","url":"https://api.github.com/users/moneyadviceservice","html_url":"https://github.com/moneyadviceservice","followers_url":"https://api.github.com/users/moneyadviceservice/followers","following_url":"https://api.github.com/users/moneyadviceservice/following{/other_user}","gists_url":"https://api.github.com/users/moneyadviceservice/gists{/gist_id}","starred_url":"https://api.github.com/users/moneyadviceservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneyadviceservice/subscriptions","organizations_url":"https://api.github.com/users/moneyadviceservice/orgs","repos_url":"https://api.github.com/users/moneyadviceservice/repos","events_url":"https://api.github.com/users/moneyadviceservice/events{/privacy}","received_events_url":"https://api.github.com/users/moneyadviceservice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moneyadviceservice/cms","description":"The MAS CMS","fork":false,"url":"https://api.github.com/repos/moneyadviceservice/cms","forks_url":"https://api.github.com/repos/moneyadviceservice/cms/forks","keys_url":"https://api.github.com/repos/moneyadviceservice/cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moneyadviceservice/cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moneyadviceservice/cms/teams","hooks_url":"https://api.github.com/repos/moneyadviceservice/cms/hooks","issue_events_url":"https://api.github.com/repos/moneyadviceservice/cms/issues/events{/number}","events_url":"https://api.github.com/repos/moneyadviceservice/cms/events","assignees_url":"https://api.github.com/repos/moneyadviceservice/cms/assignees{/user}","branches_url":"https://api.github.com/repos/moneyadviceservice/cms/branches{/branch}","tags_url":"https://api.github.com/repos/moneyadviceservice/cms/tags","blobs_url":"https://api.github.com/repos/moneyadviceservice/cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moneyadviceservice/cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moneyadviceservice/cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/moneyadviceservice/cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moneyadviceservice/cms/statuses/{sha}","languages_url":"https://api.github.com/repos/moneyadviceservice/cms/languages","stargazers_url":"https://api.github.com/repos/moneyadviceservice/cms/stargazers","contributors_url":"https://api.github.com/repos/moneyadviceservice/cms/contributors","subscribers_url":"https://api.github.com/repos/moneyadviceservice/cms/subscribers","subscription_url":"https://api.github.com/repos/moneyadviceservice/cms/subscription","commits_url":"https://api.github.com/repos/moneyadviceservice/cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/moneyadviceservice/cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/moneyadviceservice/cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/moneyadviceservice/cms/issues/comments/{number}","contents_url":"https://api.github.com/repos/moneyadviceservice/cms/contents/{+path}","compare_url":"https://api.github.com/repos/moneyadviceservice/cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moneyadviceservice/cms/merges","archive_url":"https://api.github.com/repos/moneyadviceservice/cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moneyadviceservice/cms/downloads","issues_url":"https://api.github.com/repos/moneyadviceservice/cms/issues{/number}","pulls_url":"https://api.github.com/repos/moneyadviceservice/cms/pulls{/number}","milestones_url":"https://api.github.com/repos/moneyadviceservice/cms/milestones{/number}","notifications_url":"https://api.github.com/repos/moneyadviceservice/cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moneyadviceservice/cms/labels{/name}","releases_url":"https://api.github.com/repos/moneyadviceservice/cms/releases{/id}","created_at":"2014-06-26T11:26:25Z","updated_at":"2014-09-08T10:29:15Z","pushed_at":"2014-10-24T10:43:58Z","git_url":"git://github.com/moneyadviceservice/cms.git","ssh_url":"git@github.com:moneyadviceservice/cms.git","clone_url":"https://github.com/moneyadviceservice/cms.git","svn_url":"https://github.com/moneyadviceservice/cms","homepage":null,"size":6104,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/moneyadviceservice/cms/pulls/49"},"html":{"href":"https://github.com/moneyadviceservice/cms/pull/49"},"issue":{"href":"https://api.github.com/repos/moneyadviceservice/cms/issues/49"},"comments":{"href":"https://api.github.com/repos/moneyadviceservice/cms/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/moneyadviceservice/cms/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/moneyadviceservice/cms/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/moneyadviceservice/cms/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/moneyadviceservice/cms/statuses/dff768f6b5ce717f3cdba648557fd9d8858609bc"}}}}