{"action":"created","comment":{"url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls/comments/168728994","pull_request_review_id":97144828,"id":168728994,"diff_hunk":"@@ -24,8 +24,10 @@ def generate_new_report\n         csv << Settings.claim_csv_headers.map { |header| header.to_s.humanize }\n         Claim::BaseClaim.active.non_draft.find_each do |claim|\n           ClaimCsvPresenter.new(claim, 'view').present! do |claim_journeys|\n-            claim_journeys.each do |claim_journey|\n-              csv << claim_journey\n+            if claim_journeys.any?\n+              claim_journeys.each do |claim_journey|","path":"app/models/stats/management_information_generator.rb","position":7,"original_position":7,"commit_id":"4ad683b578261c791ec45f1696bbe51915307b24","original_commit_id":"4ad683b578261c791ec45f1696bbe51915307b24","user":{"login":"lostie","id":67125,"avatar_url":"https://avatars2.githubusercontent.com/u/67125?v=4","gravatar_id":"","url":"https://api.github.com/users/lostie","html_url":"https://github.com/lostie","followers_url":"https://api.github.com/users/lostie/followers","following_url":"https://api.github.com/users/lostie/following{/other_user}","gists_url":"https://api.github.com/users/lostie/gists{/gist_id}","starred_url":"https://api.github.com/users/lostie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lostie/subscriptions","organizations_url":"https://api.github.com/users/lostie/orgs","repos_url":"https://api.github.com/users/lostie/repos","events_url":"https://api.github.com/users/lostie/events{/privacy}","received_events_url":"https://api.github.com/users/lostie/received_events","type":"User","site_admin":false},"body":"I would probably just use `claim_journeys.compact` then if that is the case, but again, no blockers, your solution works as well ;)","created_at":"2018-02-16T11:07:42Z","updated_at":"2018-02-16T11:07:42Z","html_url":"https://github.com/ministryofjustice/Claim-for-Crown-Court-Defence/pull/2242#discussion_r168728994","pull_request_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls/2242","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls/comments/168728994"},"html":{"href":"https://github.com/ministryofjustice/Claim-for-Crown-Court-Defence/pull/2242#discussion_r168728994"},"pull_request":{"href":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls/2242"}},"in_reply_to_id":168726031},"pull_request":{"url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls/2242","id":169585645,"html_url":"https://github.com/ministryofjustice/Claim-for-Crown-Court-Defence/pull/2242","diff_url":"https://github.com/ministryofjustice/Claim-for-Crown-Court-Defence/pull/2242.diff","patch_url":"https://github.com/ministryofjustice/Claim-for-Crown-Court-Defence/pull/2242.patch","issue_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/issues/2242","number":2242,"state":"open","locked":false,"title":"MI fix","user":{"login":"colinbruce","id":6757677,"avatar_url":"https://avatars1.githubusercontent.com/u/6757677?v=4","gravatar_id":"","url":"https://api.github.com/users/colinbruce","html_url":"https://github.com/colinbruce","followers_url":"https://api.github.com/users/colinbruce/followers","following_url":"https://api.github.com/users/colinbruce/following{/other_user}","gists_url":"https://api.github.com/users/colinbruce/gists{/gist_id}","starred_url":"https://api.github.com/users/colinbruce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinbruce/subscriptions","organizations_url":"https://api.github.com/users/colinbruce/orgs","repos_url":"https://api.github.com/users/colinbruce/repos","events_url":"https://api.github.com/users/colinbruce/events{/privacy}","received_events_url":"https://api.github.com/users/colinbruce/received_events","type":"User","site_admin":false},"body":"An edge case has occurred where all claim_state_transitions are ineligible, this meant that MI failed\r\n\r\nThis allows the `parsed_journey` method to return nothing and handle that in `present!` and then skip that row in `management_information_generator`","created_at":"2018-02-16T10:06:37Z","updated_at":"2018-02-16T11:07:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"274a662e55422837fb9463933ebfa73096ffaa54","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":598645038,"url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/labels/donotmerge","name":"donotmerge","color":"b60205","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls/2242/commits","review_comments_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls/2242/comments","review_comment_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/issues/2242/comments","statuses_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/statuses/4ad683b578261c791ec45f1696bbe51915307b24","head":{"label":"ministryofjustice:mi-fix","ref":"mi-fix","sha":"4ad683b578261c791ec45f1696bbe51915307b24","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":32451549,"name":"Claim-for-Crown-Court-Defence","full_name":"ministryofjustice/Claim-for-Crown-Court-Defence","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/Claim-for-Crown-Court-Defence","description":"Claim for Crown Court Defence, formerly Advocate Defence Payments (ADP), aka Crime Billing Online (CBO)","fork":false,"url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence","forks_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/forks","keys_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/events","assignees_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/merges","archive_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/deployments","created_at":"2015-03-18T10:10:18Z","updated_at":"2017-09-19T15:49:46Z","pushed_at":"2018-02-16T10:46:03Z","git_url":"git://github.com/ministryofjustice/Claim-for-Crown-Court-Defence.git","ssh_url":"git@github.com:ministryofjustice/Claim-for-Crown-Court-Defence.git","clone_url":"https://github.com/ministryofjustice/Claim-for-Crown-Court-Defence.git","svn_url":"https://github.com/ministryofjustice/Claim-for-Crown-Court-Defence","homepage":"","size":18495,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":5,"default_branch":"master"}},"base":{"label":"ministryofjustice:master","ref":"master","sha":"230cc9e1f138968a2e5a293381ab2314156b6df9","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":32451549,"name":"Claim-for-Crown-Court-Defence","full_name":"ministryofjustice/Claim-for-Crown-Court-Defence","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/Claim-for-Crown-Court-Defence","description":"Claim for Crown Court Defence, formerly Advocate Defence Payments (ADP), aka Crime Billing Online (CBO)","fork":false,"url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence","forks_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/forks","keys_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/events","assignees_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/merges","archive_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/deployments","created_at":"2015-03-18T10:10:18Z","updated_at":"2017-09-19T15:49:46Z","pushed_at":"2018-02-16T10:46:03Z","git_url":"git://github.com/ministryofjustice/Claim-for-Crown-Court-Defence.git","ssh_url":"git@github.com:ministryofjustice/Claim-for-Crown-Court-Defence.git","clone_url":"https://github.com/ministryofjustice/Claim-for-Crown-Court-Defence.git","svn_url":"https://github.com/ministryofjustice/Claim-for-Crown-Court-Defence","homepage":"","size":18495,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls/2242"},"html":{"href":"https://github.com/ministryofjustice/Claim-for-Crown-Court-Defence/pull/2242"},"issue":{"href":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/issues/2242"},"comments":{"href":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/issues/2242/comments"},"review_comments":{"href":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls/2242/comments"},"review_comment":{"href":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/pulls/2242/commits"},"statuses":{"href":"https://api.github.com/repos/ministryofjustice/Claim-for-Crown-Court-Defence/statuses/4ad683b578261c791ec45f1696bbe51915307b24"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lostie"}}