GitHub PullRequestReviewCommentEvent at 2014-11-11 21:50:22
Repository: refinerycms
Actor: awagener
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/refinery/refinerycms/pulls/comments/20183273","id":20183273,"diff_hunk":"@@ -216,18 +216,14 @@ def destroy!\n     end\n \n     # Used for the browser title to get the full path to this page\n-    # It automatically prints out this page title and all of it's parent page titles joined by a PATH_SEPARATOR\n-    def path(options = {})\n-      # Override default options with any supplied.\n-      options = {:reversed => true}.merge(options)\n-\n-      if parent_id\n-        parts = [title, parent.path(options)]\n-        parts.reverse! if options[:reversed]\n-        parts.join(' - ')\n-      else\n-        title\n-      end\n+    # It automatically prints out this page title and all of its parent page\n+    # titles joined by a PATH_SEPARATOR\n+    def path(reversed: true)\n+      return title if root?\n+\n+      titles = self_and_ancestors.reverse.map(&:title)\n+      titles.reverse! if reversed","path":"pages/app/models/refinery/page.rb","position":22,"original_position":22,"commit_id":"fb480d98d5f4ff9a6c2d488925c39978a0c5d266","original_commit_id":"fb480d98d5f4ff9a6c2d488925c39978a0c5d266","user":{"login":"awagener","id":189705,"avatar_url":"https://avatars.githubusercontent.com/u/189705?v=3","gravatar_id":"","url":"https://api.github.com/users/awagener","html_url":"https://github.com/awagener","followers_url":"https://api.github.com/users/awagener/followers","following_url":"https://api.github.com/users/awagener/following{/other_user}","gists_url":"https://api.github.com/users/awagener/gists{/gist_id}","starred_url":"https://api.github.com/users/awagener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awagener/subscriptions","organizations_url":"https://api.github.com/users/awagener/orgs","repos_url":"https://api.github.com/users/awagener/repos","events_url":"https://api.github.com/users/awagener/events{/privacy}","received_events_url":"https://api.github.com/users/awagener/received_events","type":"User","site_admin":false},"body":"How about naming the parameter something else, like `child_first` or `parent_first` or something that isn't `reversed`?  The problem is to understand `reversed`, you need to know what the default order is, which I... don't.","created_at":"2014-11-11T21:50:22Z","updated_at":"2014-11-11T21:50:22Z","html_url":"https://github.com/refinery/refinerycms/pull/2752#discussion_r20183273","pull_request_url":"https://api.github.com/repos/refinery/refinerycms/pulls/2752","_links":{"self":{"href":"https://api.github.com/repos/refinery/refinerycms/pulls/comments/20183273"},"html":{"href":"https://github.com/refinery/refinerycms/pull/2752#discussion_r20183273"},"pull_request":{"href":"https://api.github.com/repos/refinery/refinerycms/pulls/2752"}}},"pull_request":{"url":"https://api.github.com/repos/refinery/refinerycms/pulls/2752","id":24199791,"html_url":"https://github.com/refinery/refinerycms/pull/2752","diff_url":"https://github.com/refinery/refinerycms/pull/2752.diff","patch_url":"https://github.com/refinery/refinerycms/pull/2752.patch","issue_url":"https://api.github.com/repos/refinery/refinerycms/issues/2752","number":2752,"state":"open","locked":false,"title":"Optimised queries for Page#nested_url and Page#path","user":{"login":"parndt","id":10128,"avatar_url":"https://avatars.githubusercontent.com/u/10128?v=3","gravatar_id":"","url":"https://api.github.com/users/parndt","html_url":"https://github.com/parndt","followers_url":"https://api.github.com/users/parndt/followers","following_url":"https://api.github.com/users/parndt/following{/other_user}","gists_url":"https://api.github.com/users/parndt/gists{/gist_id}","starred_url":"https://api.github.com/users/parndt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parndt/subscriptions","organizations_url":"https://api.github.com/users/parndt/orgs","repos_url":"https://api.github.com/users/parndt/repos","events_url":"https://api.github.com/users/parndt/events{/privacy}","received_events_url":"https://api.github.com/users/parndt/received_events","type":"User","site_admin":false},"body":"This makes use of ancestors instead of iterating through all parents.\r\nThis means one database query, not several.\r\n\r\nWe still have too many queries but this should speed things up quite a lot - which should make @simi happier.\r\n\r\nPotentially fixes #2087","created_at":"2014-11-11T05:43:47Z","updated_at":"2014-11-11T21:50:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1bb6f00b7e1143ebd3d5560009d3e6e31a6a8dd5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/refinery/refinerycms/pulls/2752/commits","review_comments_url":"https://api.github.com/repos/refinery/refinerycms/pulls/2752/comments","review_comment_url":"https://api.github.com/repos/refinery/refinerycms/pulls/comments/{number}","comments_url":"https://api.github.com/repos/refinery/refinerycms/issues/2752/comments","statuses_url":"https://api.github.com/repos/refinery/refinerycms/statuses/fb480d98d5f4ff9a6c2d488925c39978a0c5d266","head":{"label":"refinery:performance/reduce-queries-for-pages-menu","ref":"performance/reduce-queries-for-pages-menu","sha":"fb480d98d5f4ff9a6c2d488925c39978a0c5d266","user":{"login":"refinery","id":339098,"avatar_url":"https://avatars.githubusercontent.com/u/339098?v=3","gravatar_id":"","url":"https://api.github.com/users/refinery","html_url":"https://github.com/refinery","followers_url":"https://api.github.com/users/refinery/followers","following_url":"https://api.github.com/users/refinery/following{/other_user}","gists_url":"https://api.github.com/users/refinery/gists{/gist_id}","starred_url":"https://api.github.com/users/refinery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refinery/subscriptions","organizations_url":"https://api.github.com/users/refinery/orgs","repos_url":"https://api.github.com/users/refinery/repos","events_url":"https://api.github.com/users/refinery/events{/privacy}","received_events_url":"https://api.github.com/users/refinery/received_events","type":"Organization","site_admin":false},"repo":{"id":212862,"name":"refinerycms","full_name":"refinery/refinerycms","owner":{"login":"refinery","id":339098,"avatar_url":"https://avatars.githubusercontent.com/u/339098?v=3","gravatar_id":"","url":"https://api.github.com/users/refinery","html_url":"https://github.com/refinery","followers_url":"https://api.github.com/users/refinery/followers","following_url":"https://api.github.com/users/refinery/following{/other_user}","gists_url":"https://api.github.com/users/refinery/gists{/gist_id}","starred_url":"https://api.github.com/users/refinery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refinery/subscriptions","organizations_url":"https://api.github.com/users/refinery/orgs","repos_url":"https://api.github.com/users/refinery/repos","events_url":"https://api.github.com/users/refinery/events{/privacy}","received_events_url":"https://api.github.com/users/refinery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/refinery/refinerycms","description":"An extendable Ruby on Rails CMS that supports Rails 3.2 and 4.1","fork":false,"url":"https://api.github.com/repos/refinery/refinerycms","forks_url":"https://api.github.com/repos/refinery/refinerycms/forks","keys_url":"https://api.github.com/repos/refinery/refinerycms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/refinery/refinerycms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/refinery/refinerycms/teams","hooks_url":"https://api.github.com/repos/refinery/refinerycms/hooks","issue_events_url":"https://api.github.com/repos/refinery/refinerycms/issues/events{/number}","events_url":"https://api.github.com/repos/refinery/refinerycms/events","assignees_url":"https://api.github.com/repos/refinery/refinerycms/assignees{/user}","branches_url":"https://api.github.com/repos/refinery/refinerycms/branches{/branch}","tags_url":"https://api.github.com/repos/refinery/refinerycms/tags","blobs_url":"https://api.github.com/repos/refinery/refinerycms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/refinery/refinerycms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/refinery/refinerycms/git/refs{/sha}","trees_url":"https://api.github.com/repos/refinery/refinerycms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/refinery/refinerycms/statuses/{sha}","languages_url":"https://api.github.com/repos/refinery/refinerycms/languages","stargazers_url":"https://api.github.com/repos/refinery/refinerycms/stargazers","contributors_url":"https://api.github.com/repos/refinery/refinerycms/contributors","subscribers_url":"https://api.github.com/repos/refinery/refinerycms/subscribers","subscription_url":"https://api.github.com/repos/refinery/refinerycms/subscription","commits_url":"https://api.github.com/repos/refinery/refinerycms/commits{/sha}","git_commits_url":"https://api.github.com/repos/refinery/refinerycms/git/commits{/sha}","comments_url":"https://api.github.com/repos/refinery/refinerycms/comments{/number}","issue_comment_url":"https://api.github.com/repos/refinery/refinerycms/issues/comments/{number}","contents_url":"https://api.github.com/repos/refinery/refinerycms/contents/{+path}","compare_url":"https://api.github.com/repos/refinery/refinerycms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/refinery/refinerycms/merges","archive_url":"https://api.github.com/repos/refinery/refinerycms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/refinery/refinerycms/downloads","issues_url":"https://api.github.com/repos/refinery/refinerycms/issues{/number}","pulls_url":"https://api.github.com/repos/refinery/refinerycms/pulls{/number}","milestones_url":"https://api.github.com/repos/refinery/refinerycms/milestones{/number}","notifications_url":"https://api.github.com/repos/refinery/refinerycms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/refinery/refinerycms/labels{/name}","releases_url":"https://api.github.com/repos/refinery/refinerycms/releases{/id}","created_at":"2009-05-28T20:13:21Z","updated_at":"2014-11-11T21:25:21Z","pushed_at":"2014-11-11T05:29:05Z","git_url":"git://github.com/refinery/refinerycms.git","ssh_url":"git@github.com:refinery/refinerycms.git","clone_url":"https://github.com/refinery/refinerycms.git","svn_url":"https://github.com/refinery/refinerycms","homepage":"http://refinerycms.com/guides/","size":50036,"stargazers_count":2990,"watchers_count":2990,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":1150,"mirror_url":null,"open_issues_count":34,"forks":1150,"open_issues":34,"watchers":2990,"default_branch":"master"}},"base":{"label":"refinery:master","ref":"master","sha":"aec29435f3f51aa59fa360fa9f0288c017cd7e2e","user":{"login":"refinery","id":339098,"avatar_url":"https://avatars.githubusercontent.com/u/339098?v=3","gravatar_id":"","url":"https://api.github.com/users/refinery","html_url":"https://github.com/refinery","followers_url":"https://api.github.com/users/refinery/followers","following_url":"https://api.github.com/users/refinery/following{/other_user}","gists_url":"https://api.github.com/users/refinery/gists{/gist_id}","starred_url":"https://api.github.com/users/refinery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refinery/subscriptions","organizations_url":"https://api.github.com/users/refinery/orgs","repos_url":"https://api.github.com/users/refinery/repos","events_url":"https://api.github.com/users/refinery/events{/privacy}","received_events_url":"https://api.github.com/users/refinery/received_events","type":"Organization","site_admin":false},"repo":{"id":212862,"name":"refinerycms","full_name":"refinery/refinerycms","owner":{"login":"refinery","id":339098,"avatar_url":"https://avatars.githubusercontent.com/u/339098?v=3","gravatar_id":"","url":"https://api.github.com/users/refinery","html_url":"https://github.com/refinery","followers_url":"https://api.github.com/users/refinery/followers","following_url":"https://api.github.com/users/refinery/following{/other_user}","gists_url":"https://api.github.com/users/refinery/gists{/gist_id}","starred_url":"https://api.github.com/users/refinery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refinery/subscriptions","organizations_url":"https://api.github.com/users/refinery/orgs","repos_url":"https://api.github.com/users/refinery/repos","events_url":"https://api.github.com/users/refinery/events{/privacy}","received_events_url":"https://api.github.com/users/refinery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/refinery/refinerycms","description":"An extendable Ruby on Rails CMS that supports Rails 3.2 and 4.1","fork":false,"url":"https://api.github.com/repos/refinery/refinerycms","forks_url":"https://api.github.com/repos/refinery/refinerycms/forks","keys_url":"https://api.github.com/repos/refinery/refinerycms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/refinery/refinerycms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/refinery/refinerycms/teams","hooks_url":"https://api.github.com/repos/refinery/refinerycms/hooks","issue_events_url":"https://api.github.com/repos/refinery/refinerycms/issues/events{/number}","events_url":"https://api.github.com/repos/refinery/refinerycms/events","assignees_url":"https://api.github.com/repos/refinery/refinerycms/assignees{/user}","branches_url":"https://api.github.com/repos/refinery/refinerycms/branches{/branch}","tags_url":"https://api.github.com/repos/refinery/refinerycms/tags","blobs_url":"https://api.github.com/repos/refinery/refinerycms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/refinery/refinerycms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/refinery/refinerycms/git/refs{/sha}","trees_url":"https://api.github.com/repos/refinery/refinerycms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/refinery/refinerycms/statuses/{sha}","languages_url":"https://api.github.com/repos/refinery/refinerycms/languages","stargazers_url":"https://api.github.com/repos/refinery/refinerycms/stargazers","contributors_url":"https://api.github.com/repos/refinery/refinerycms/contributors","subscribers_url":"https://api.github.com/repos/refinery/refinerycms/subscribers","subscription_url":"https://api.github.com/repos/refinery/refinerycms/subscription","commits_url":"https://api.github.com/repos/refinery/refinerycms/commits{/sha}","git_commits_url":"https://api.github.com/repos/refinery/refinerycms/git/commits{/sha}","comments_url":"https://api.github.com/repos/refinery/refinerycms/comments{/number}","issue_comment_url":"https://api.github.com/repos/refinery/refinerycms/issues/comments/{number}","contents_url":"https://api.github.com/repos/refinery/refinerycms/contents/{+path}","compare_url":"https://api.github.com/repos/refinery/refinerycms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/refinery/refinerycms/merges","archive_url":"https://api.github.com/repos/refinery/refinerycms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/refinery/refinerycms/downloads","issues_url":"https://api.github.com/repos/refinery/refinerycms/issues{/number}","pulls_url":"https://api.github.com/repos/refinery/refinerycms/pulls{/number}","milestones_url":"https://api.github.com/repos/refinery/refinerycms/milestones{/number}","notifications_url":"https://api.github.com/repos/refinery/refinerycms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/refinery/refinerycms/labels{/name}","releases_url":"https://api.github.com/repos/refinery/refinerycms/releases{/id}","created_at":"2009-05-28T20:13:21Z","updated_at":"2014-11-11T21:25:21Z","pushed_at":"2014-11-11T05:29:05Z","git_url":"git://github.com/refinery/refinerycms.git","ssh_url":"git@github.com:refinery/refinerycms.git","clone_url":"https://github.com/refinery/refinerycms.git","svn_url":"https://github.com/refinery/refinerycms","homepage":"http://refinerycms.com/guides/","size":50036,"stargazers_count":2990,"watchers_count":2990,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":1150,"mirror_url":null,"open_issues_count":34,"forks":1150,"open_issues":34,"watchers":2990,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/refinery/refinerycms/pulls/2752"},"html":{"href":"https://github.com/refinery/refinerycms/pull/2752"},"issue":{"href":"https://api.github.com/repos/refinery/refinerycms/issues/2752"},"comments":{"href":"https://api.github.com/repos/refinery/refinerycms/issues/2752/comments"},"review_comments":{"href":"https://api.github.com/repos/refinery/refinerycms/pulls/2752/comments"},"review_comment":{"href":"https://api.github.com/repos/refinery/refinerycms/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/refinery/refinerycms/pulls/2752/commits"},"statuses":{"href":"https://api.github.com/repos/refinery/refinerycms/statuses/fb480d98d5f4ff9a6c2d488925c39978a0c5d266"}}}}