{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/content-tagger/pulls/comments/76430452","id":76430452,"diff_hunk":"@@ -0,0 +1,47 @@\n+class ExpandedTaxonomy","path":"app/models/expanded_taxonomy.rb","position":1,"original_position":1,"commit_id":"204437f487152130f0d8293fdbed9dc5432510fd","original_commit_id":"99060bce3099af7659ad2ea0b75ddef34b3783a6","user":{"login":"mobaig","id":519250,"avatar_url":"https://avatars.githubusercontent.com/u/519250?v=3","gravatar_id":"","url":"https://api.github.com/users/mobaig","html_url":"https://github.com/mobaig","followers_url":"https://api.github.com/users/mobaig/followers","following_url":"https://api.github.com/users/mobaig/following{/other_user}","gists_url":"https://api.github.com/users/mobaig/gists{/gist_id}","starred_url":"https://api.github.com/users/mobaig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobaig/subscriptions","organizations_url":"https://api.github.com/users/mobaig/orgs","repos_url":"https://api.github.com/users/mobaig/repos","events_url":"https://api.github.com/users/mobaig/events{/privacy}","received_events_url":"https://api.github.com/users/mobaig/received_events","type":"User","site_admin":false},"body":"@carvil Rewritten in this form it doesn't actually help much in terms of readability - certainly not relative to the additional logic and naming complexity it introduces. The main issue being that a lot of the hash access you see is the API of a TreeNode rather than a hash from the GdsApiAdapters.\r\n\r\nA potential refactor might be to replace `TreeNode` with our own version that provides exactly the same interface but puts `content_id` and `parent_taxons` behind proper methods - rather than the `content` hash provided by `TreeNode`. That feels like a little more than this PR should aim to cover right now, though.","created_at":"2016-08-26T14:44:57Z","updated_at":"2016-08-26T14:44:57Z","html_url":"https://github.com/alphagov/content-tagger/pull/143#discussion_r76430452","pull_request_url":"https://api.github.com/repos/alphagov/content-tagger/pulls/143","_links":{"self":{"href":"https://api.github.com/repos/alphagov/content-tagger/pulls/comments/76430452"},"html":{"href":"https://github.com/alphagov/content-tagger/pull/143#discussion_r76430452"},"pull_request":{"href":"https://api.github.com/repos/alphagov/content-tagger/pulls/143"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/content-tagger/pulls/143","id":82882313,"html_url":"https://github.com/alphagov/content-tagger/pull/143","diff_url":"https://github.com/alphagov/content-tagger/pull/143.diff","patch_url":"https://github.com/alphagov/content-tagger/pull/143.patch","issue_url":"https://api.github.com/repos/alphagov/content-tagger/issues/143","number":143,"state":"open","locked":false,"title":"Add taxonomy visualisation","user":{"login":"mobaig","id":519250,"avatar_url":"https://avatars.githubusercontent.com/u/519250?v=3","gravatar_id":"","url":"https://api.github.com/users/mobaig","html_url":"https://github.com/mobaig","followers_url":"https://api.github.com/users/mobaig/followers","following_url":"https://api.github.com/users/mobaig/following{/other_user}","gists_url":"https://api.github.com/users/mobaig/gists{/gist_id}","starred_url":"https://api.github.com/users/mobaig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobaig/subscriptions","organizations_url":"https://api.github.com/users/mobaig/orgs","repos_url":"https://api.github.com/users/mobaig/repos","events_url":"https://api.github.com/users/mobaig/events{/privacy}","received_events_url":"https://api.github.com/users/mobaig/received_events","type":"User","site_admin":false},"body":"View the descendants of any taxon, displayed as a tree.\r\n\r\n- Adds an ExpandedTaxonomy class to fetch required data from the\r\n  publishing API and use it to construct a tree.\r\n- Uses the ruby-tree gem to provide a convenient interface for tree\r\n  traversal and determining node depth.\r\n- Some basic styling to visually distinguish different levels of the\r\n  taxonomy.\r\n\r\n![screen shot 2016-08-26 at 13 54 56](https://cloud.githubusercontent.com/assets/519250/18005905/cac66d32-6b94-11e6-873b-67d6ee8214dd.png)\r\n","created_at":"2016-08-26T12:48:46Z","updated_at":"2016-08-26T14:44:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb1ced3957e1582960dd693bcad9ab094edd8fcc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/content-tagger/pulls/143/commits","review_comments_url":"https://api.github.com/repos/alphagov/content-tagger/pulls/143/comments","review_comment_url":"https://api.github.com/repos/alphagov/content-tagger/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/content-tagger/issues/143/comments","statuses_url":"https://api.github.com/repos/alphagov/content-tagger/statuses/204437f487152130f0d8293fdbed9dc5432510fd","head":{"label":"alphagov:mb-taxon-visual","ref":"mb-taxon-visual","sha":"204437f487152130f0d8293fdbed9dc5432510fd","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":46417722,"name":"content-tagger","full_name":"alphagov/content-tagger","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/content-tagger","description":"Application for tagging content on GOV.UK","fork":false,"url":"https://api.github.com/repos/alphagov/content-tagger","forks_url":"https://api.github.com/repos/alphagov/content-tagger/forks","keys_url":"https://api.github.com/repos/alphagov/content-tagger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/content-tagger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/content-tagger/teams","hooks_url":"https://api.github.com/repos/alphagov/content-tagger/hooks","issue_events_url":"https://api.github.com/repos/alphagov/content-tagger/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/content-tagger/events","assignees_url":"https://api.github.com/repos/alphagov/content-tagger/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/content-tagger/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/content-tagger/tags","blobs_url":"https://api.github.com/repos/alphagov/content-tagger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/content-tagger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/content-tagger/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/content-tagger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/content-tagger/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/content-tagger/languages","stargazers_url":"https://api.github.com/repos/alphagov/content-tagger/stargazers","contributors_url":"https://api.github.com/repos/alphagov/content-tagger/contributors","subscribers_url":"https://api.github.com/repos/alphagov/content-tagger/subscribers","subscription_url":"https://api.github.com/repos/alphagov/content-tagger/subscription","commits_url":"https://api.github.com/repos/alphagov/content-tagger/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/content-tagger/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/content-tagger/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/content-tagger/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/content-tagger/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/content-tagger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/content-tagger/merges","archive_url":"https://api.github.com/repos/alphagov/content-tagger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/content-tagger/downloads","issues_url":"https://api.github.com/repos/alphagov/content-tagger/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/content-tagger/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/content-tagger/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/content-tagger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/content-tagger/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/content-tagger/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/content-tagger/deployments","created_at":"2015-11-18T12:36:10Z","updated_at":"2016-08-13T09:38:36Z","pushed_at":"2016-08-26T14:39:38Z","git_url":"git://github.com/alphagov/content-tagger.git","ssh_url":"git@github.com:alphagov/content-tagger.git","clone_url":"https://github.com/alphagov/content-tagger.git","svn_url":"https://github.com/alphagov/content-tagger","homepage":"https://content-tagger.publishing.service.gov.uk/","size":2637,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"57b92dfef602e0e729b93e8624d0f40b70e906bf","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":46417722,"name":"content-tagger","full_name":"alphagov/content-tagger","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/content-tagger","description":"Application for tagging content on GOV.UK","fork":false,"url":"https://api.github.com/repos/alphagov/content-tagger","forks_url":"https://api.github.com/repos/alphagov/content-tagger/forks","keys_url":"https://api.github.com/repos/alphagov/content-tagger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/content-tagger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/content-tagger/teams","hooks_url":"https://api.github.com/repos/alphagov/content-tagger/hooks","issue_events_url":"https://api.github.com/repos/alphagov/content-tagger/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/content-tagger/events","assignees_url":"https://api.github.com/repos/alphagov/content-tagger/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/content-tagger/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/content-tagger/tags","blobs_url":"https://api.github.com/repos/alphagov/content-tagger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/content-tagger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/content-tagger/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/content-tagger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/content-tagger/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/content-tagger/languages","stargazers_url":"https://api.github.com/repos/alphagov/content-tagger/stargazers","contributors_url":"https://api.github.com/repos/alphagov/content-tagger/contributors","subscribers_url":"https://api.github.com/repos/alphagov/content-tagger/subscribers","subscription_url":"https://api.github.com/repos/alphagov/content-tagger/subscription","commits_url":"https://api.github.com/repos/alphagov/content-tagger/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/content-tagger/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/content-tagger/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/content-tagger/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/content-tagger/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/content-tagger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/content-tagger/merges","archive_url":"https://api.github.com/repos/alphagov/content-tagger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/content-tagger/downloads","issues_url":"https://api.github.com/repos/alphagov/content-tagger/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/content-tagger/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/content-tagger/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/content-tagger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/content-tagger/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/content-tagger/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/content-tagger/deployments","created_at":"2015-11-18T12:36:10Z","updated_at":"2016-08-13T09:38:36Z","pushed_at":"2016-08-26T14:39:38Z","git_url":"git://github.com/alphagov/content-tagger.git","ssh_url":"git@github.com:alphagov/content-tagger.git","clone_url":"https://github.com/alphagov/content-tagger.git","svn_url":"https://github.com/alphagov/content-tagger","homepage":"https://content-tagger.publishing.service.gov.uk/","size":2637,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/content-tagger/pulls/143"},"html":{"href":"https://github.com/alphagov/content-tagger/pull/143"},"issue":{"href":"https://api.github.com/repos/alphagov/content-tagger/issues/143"},"comments":{"href":"https://api.github.com/repos/alphagov/content-tagger/issues/143/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/content-tagger/pulls/143/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/content-tagger/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/content-tagger/pulls/143/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/content-tagger/statuses/204437f487152130f0d8293fdbed9dc5432510fd"}}}}
{"actor":{"display_login":"mobaig"}}