{"action":"created","comment":{"url":"https://api.github.com/repos/lastcat/factory_logger/pulls/comments/31601637","id":31601637,"diff_hunk":"@@ -80,4 +80,31 @@ def depth\n       asso.factory.depth\n     end.max + 1\n   end\n+\n+  # Return factory's familty array. index equal to depth.\n+  def family\n+    queue = []\n+    queue.unshift(self)\n+    results = []\n+    generation = 0\n+    while (!queue.empty?)\n+      count = queue.inject(0) { |sum, factory| sum + factory.assos.size }\n+      break if count == 0\n+      results[generation] = []\n+      while (count > 0)","path":"app/models/factory.rb","position":15,"original_position":15,"commit_id":"5d2e2d85d440ba07b369508f8f36b5b7aae2c37b","original_commit_id":"5d2e2d85d440ba07b369508f8f36b5b7aae2c37b","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Style/ParenthesesAroundCondition: Don't use parentheses around the condition of a `while`.","created_at":"2015-06-03T08:10:07Z","updated_at":"2015-06-03T08:10:07Z","html_url":"https://github.com/lastcat/factory_logger/pull/44#discussion_r31601637","pull_request_url":"https://api.github.com/repos/lastcat/factory_logger/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/lastcat/factory_logger/pulls/comments/31601637"},"html":{"href":"https://github.com/lastcat/factory_logger/pull/44#discussion_r31601637"},"pull_request":{"href":"https://api.github.com/repos/lastcat/factory_logger/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/lastcat/factory_logger/pulls/44","id":36807439,"html_url":"https://github.com/lastcat/factory_logger/pull/44","diff_url":"https://github.com/lastcat/factory_logger/pull/44.diff","patch_url":"https://github.com/lastcat/factory_logger/pull/44.patch","issue_url":"https://api.github.com/repos/lastcat/factory_logger/issues/44","number":44,"state":"open","locked":false,"title":"add family and to_s method","user":{"login":"lastcat","id":2026375,"avatar_url":"https://avatars.githubusercontent.com/u/2026375?v=3","gravatar_id":"","url":"https://api.github.com/users/lastcat","html_url":"https://github.com/lastcat","followers_url":"https://api.github.com/users/lastcat/followers","following_url":"https://api.github.com/users/lastcat/following{/other_user}","gists_url":"https://api.github.com/users/lastcat/gists{/gist_id}","starred_url":"https://api.github.com/users/lastcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lastcat/subscriptions","organizations_url":"https://api.github.com/users/lastcat/orgs","repos_url":"https://api.github.com/users/lastcat/repos","events_url":"https://api.github.com/users/lastcat/events{/privacy}","received_events_url":"https://api.github.com/users/lastcat/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-03T08:08:17Z","updated_at":"2015-06-03T08:10:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba68b22d14cf8f9899a1753a32f35fd76e71ba6f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lastcat/factory_logger/pulls/44/commits","review_comments_url":"https://api.github.com/repos/lastcat/factory_logger/pulls/44/comments","review_comment_url":"https://api.github.com/repos/lastcat/factory_logger/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lastcat/factory_logger/issues/44/comments","statuses_url":"https://api.github.com/repos/lastcat/factory_logger/statuses/5d2e2d85d440ba07b369508f8f36b5b7aae2c37b","head":{"label":"lastcat:add_family_and_to_s_method","ref":"add_family_and_to_s_method","sha":"5d2e2d85d440ba07b369508f8f36b5b7aae2c37b","user":{"login":"lastcat","id":2026375,"avatar_url":"https://avatars.githubusercontent.com/u/2026375?v=3","gravatar_id":"","url":"https://api.github.com/users/lastcat","html_url":"https://github.com/lastcat","followers_url":"https://api.github.com/users/lastcat/followers","following_url":"https://api.github.com/users/lastcat/following{/other_user}","gists_url":"https://api.github.com/users/lastcat/gists{/gist_id}","starred_url":"https://api.github.com/users/lastcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lastcat/subscriptions","organizations_url":"https://api.github.com/users/lastcat/orgs","repos_url":"https://api.github.com/users/lastcat/repos","events_url":"https://api.github.com/users/lastcat/events{/privacy}","received_events_url":"https://api.github.com/users/lastcat/received_events","type":"User","site_admin":false},"repo":{"id":36217773,"name":"factory_logger","full_name":"lastcat/factory_logger","owner":{"login":"lastcat","id":2026375,"avatar_url":"https://avatars.githubusercontent.com/u/2026375?v=3","gravatar_id":"","url":"https://api.github.com/users/lastcat","html_url":"https://github.com/lastcat","followers_url":"https://api.github.com/users/lastcat/followers","following_url":"https://api.github.com/users/lastcat/following{/other_user}","gists_url":"https://api.github.com/users/lastcat/gists{/gist_id}","starred_url":"https://api.github.com/users/lastcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lastcat/subscriptions","organizations_url":"https://api.github.com/users/lastcat/orgs","repos_url":"https://api.github.com/users/lastcat/repos","events_url":"https://api.github.com/users/lastcat/events{/privacy}","received_events_url":"https://api.github.com/users/lastcat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lastcat/factory_logger","description":"This is gem logging factory_girl execution info.","fork":false,"url":"https://api.github.com/repos/lastcat/factory_logger","forks_url":"https://api.github.com/repos/lastcat/factory_logger/forks","keys_url":"https://api.github.com/repos/lastcat/factory_logger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lastcat/factory_logger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lastcat/factory_logger/teams","hooks_url":"https://api.github.com/repos/lastcat/factory_logger/hooks","issue_events_url":"https://api.github.com/repos/lastcat/factory_logger/issues/events{/number}","events_url":"https://api.github.com/repos/lastcat/factory_logger/events","assignees_url":"https://api.github.com/repos/lastcat/factory_logger/assignees{/user}","branches_url":"https://api.github.com/repos/lastcat/factory_logger/branches{/branch}","tags_url":"https://api.github.com/repos/lastcat/factory_logger/tags","blobs_url":"https://api.github.com/repos/lastcat/factory_logger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lastcat/factory_logger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lastcat/factory_logger/git/refs{/sha}","trees_url":"https://api.github.com/repos/lastcat/factory_logger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lastcat/factory_logger/statuses/{sha}","languages_url":"https://api.github.com/repos/lastcat/factory_logger/languages","stargazers_url":"https://api.github.com/repos/lastcat/factory_logger/stargazers","contributors_url":"https://api.github.com/repos/lastcat/factory_logger/contributors","subscribers_url":"https://api.github.com/repos/lastcat/factory_logger/subscribers","subscription_url":"https://api.github.com/repos/lastcat/factory_logger/subscription","commits_url":"https://api.github.com/repos/lastcat/factory_logger/commits{/sha}","git_commits_url":"https://api.github.com/repos/lastcat/factory_logger/git/commits{/sha}","comments_url":"https://api.github.com/repos/lastcat/factory_logger/comments{/number}","issue_comment_url":"https://api.github.com/repos/lastcat/factory_logger/issues/comments{/number}","contents_url":"https://api.github.com/repos/lastcat/factory_logger/contents/{+path}","compare_url":"https://api.github.com/repos/lastcat/factory_logger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lastcat/factory_logger/merges","archive_url":"https://api.github.com/repos/lastcat/factory_logger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lastcat/factory_logger/downloads","issues_url":"https://api.github.com/repos/lastcat/factory_logger/issues{/number}","pulls_url":"https://api.github.com/repos/lastcat/factory_logger/pulls{/number}","milestones_url":"https://api.github.com/repos/lastcat/factory_logger/milestones{/number}","notifications_url":"https://api.github.com/repos/lastcat/factory_logger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lastcat/factory_logger/labels{/name}","releases_url":"https://api.github.com/repos/lastcat/factory_logger/releases{/id}","created_at":"2015-05-25T07:52:39Z","updated_at":"2015-05-25T07:53:34Z","pushed_at":"2015-06-03T08:10:02Z","git_url":"git://github.com/lastcat/factory_logger.git","ssh_url":"git@github.com:lastcat/factory_logger.git","clone_url":"https://github.com/lastcat/factory_logger.git","svn_url":"https://github.com/lastcat/factory_logger","homepage":null,"size":1196,"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":8,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"lastcat:master","ref":"master","sha":"b27d8e26d6f24e0a42ec3825930fb950b0b403cf","user":{"login":"lastcat","id":2026375,"avatar_url":"https://avatars.githubusercontent.com/u/2026375?v=3","gravatar_id":"","url":"https://api.github.com/users/lastcat","html_url":"https://github.com/lastcat","followers_url":"https://api.github.com/users/lastcat/followers","following_url":"https://api.github.com/users/lastcat/following{/other_user}","gists_url":"https://api.github.com/users/lastcat/gists{/gist_id}","starred_url":"https://api.github.com/users/lastcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lastcat/subscriptions","organizations_url":"https://api.github.com/users/lastcat/orgs","repos_url":"https://api.github.com/users/lastcat/repos","events_url":"https://api.github.com/users/lastcat/events{/privacy}","received_events_url":"https://api.github.com/users/lastcat/received_events","type":"User","site_admin":false},"repo":{"id":36217773,"name":"factory_logger","full_name":"lastcat/factory_logger","owner":{"login":"lastcat","id":2026375,"avatar_url":"https://avatars.githubusercontent.com/u/2026375?v=3","gravatar_id":"","url":"https://api.github.com/users/lastcat","html_url":"https://github.com/lastcat","followers_url":"https://api.github.com/users/lastcat/followers","following_url":"https://api.github.com/users/lastcat/following{/other_user}","gists_url":"https://api.github.com/users/lastcat/gists{/gist_id}","starred_url":"https://api.github.com/users/lastcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lastcat/subscriptions","organizations_url":"https://api.github.com/users/lastcat/orgs","repos_url":"https://api.github.com/users/lastcat/repos","events_url":"https://api.github.com/users/lastcat/events{/privacy}","received_events_url":"https://api.github.com/users/lastcat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lastcat/factory_logger","description":"This is gem logging factory_girl execution info.","fork":false,"url":"https://api.github.com/repos/lastcat/factory_logger","forks_url":"https://api.github.com/repos/lastcat/factory_logger/forks","keys_url":"https://api.github.com/repos/lastcat/factory_logger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lastcat/factory_logger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lastcat/factory_logger/teams","hooks_url":"https://api.github.com/repos/lastcat/factory_logger/hooks","issue_events_url":"https://api.github.com/repos/lastcat/factory_logger/issues/events{/number}","events_url":"https://api.github.com/repos/lastcat/factory_logger/events","assignees_url":"https://api.github.com/repos/lastcat/factory_logger/assignees{/user}","branches_url":"https://api.github.com/repos/lastcat/factory_logger/branches{/branch}","tags_url":"https://api.github.com/repos/lastcat/factory_logger/tags","blobs_url":"https://api.github.com/repos/lastcat/factory_logger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lastcat/factory_logger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lastcat/factory_logger/git/refs{/sha}","trees_url":"https://api.github.com/repos/lastcat/factory_logger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lastcat/factory_logger/statuses/{sha}","languages_url":"https://api.github.com/repos/lastcat/factory_logger/languages","stargazers_url":"https://api.github.com/repos/lastcat/factory_logger/stargazers","contributors_url":"https://api.github.com/repos/lastcat/factory_logger/contributors","subscribers_url":"https://api.github.com/repos/lastcat/factory_logger/subscribers","subscription_url":"https://api.github.com/repos/lastcat/factory_logger/subscription","commits_url":"https://api.github.com/repos/lastcat/factory_logger/commits{/sha}","git_commits_url":"https://api.github.com/repos/lastcat/factory_logger/git/commits{/sha}","comments_url":"https://api.github.com/repos/lastcat/factory_logger/comments{/number}","issue_comment_url":"https://api.github.com/repos/lastcat/factory_logger/issues/comments{/number}","contents_url":"https://api.github.com/repos/lastcat/factory_logger/contents/{+path}","compare_url":"https://api.github.com/repos/lastcat/factory_logger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lastcat/factory_logger/merges","archive_url":"https://api.github.com/repos/lastcat/factory_logger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lastcat/factory_logger/downloads","issues_url":"https://api.github.com/repos/lastcat/factory_logger/issues{/number}","pulls_url":"https://api.github.com/repos/lastcat/factory_logger/pulls{/number}","milestones_url":"https://api.github.com/repos/lastcat/factory_logger/milestones{/number}","notifications_url":"https://api.github.com/repos/lastcat/factory_logger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lastcat/factory_logger/labels{/name}","releases_url":"https://api.github.com/repos/lastcat/factory_logger/releases{/id}","created_at":"2015-05-25T07:52:39Z","updated_at":"2015-05-25T07:53:34Z","pushed_at":"2015-06-03T08:10:02Z","git_url":"git://github.com/lastcat/factory_logger.git","ssh_url":"git@github.com:lastcat/factory_logger.git","clone_url":"https://github.com/lastcat/factory_logger.git","svn_url":"https://github.com/lastcat/factory_logger","homepage":null,"size":1196,"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":8,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lastcat/factory_logger/pulls/44"},"html":{"href":"https://github.com/lastcat/factory_logger/pull/44"},"issue":{"href":"https://api.github.com/repos/lastcat/factory_logger/issues/44"},"comments":{"href":"https://api.github.com/repos/lastcat/factory_logger/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/lastcat/factory_logger/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/lastcat/factory_logger/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lastcat/factory_logger/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/lastcat/factory_logger/statuses/5d2e2d85d440ba07b369508f8f36b5b7aae2c37b"}}}}