{"action":"created","comment":{"url":"https://api.github.com/repos/DoSomething/gladiator/pulls/comments/60310839","id":60310839,"diff_hunk":"@@ -55,20 +56,20 @@\n                                         {{ $competition->id }}\n                                     </a>\n                                 </td>\n-                                <td class=\"table__cell\">\n-                                    @if ($competition->reportback)\n-                                        <a href=\"{{ $competition->reportback->admin_url }}\">\n-                                            {{ $competition->reportback->id }}\n-                                        </a>\n-                                    @else\n-                                        N/A\n-                                    @endif\n-                                </td>\n-                                <td class=\"table__cell\">{{ $competition->reportback->reportback_items->total or 'N/A'}}</td>\n-                                <td class=\"table__cell\">{{ $competition->reportback->quantity or 'N/A'}}</td>\n-                                <td class=\"table__cell\">{{ $competition->reportback->updated_at or 'N/A'}}</td>\n-                                <td class=\"table__cell\">{{ $competition->reportback->flagged or 'N/A' }}</td>\n-                                <td class=\"table__cell\"><a href=\"{{ route('competitions.users.destroy', ['user' => $user->id, 'competition' =>$competition->id]) }}\" class=\"button -danger\">Remove</a></td>\n+\n+                                @if ($competition->reportback)\n+                                    <td class=\"table__cell\"><a href=\"{{ reportback_admin_url($competition->reportback->id) }}\">{{ $competition->reportback->id }}</a></td>\n+                                    <td class=\"table__cell\">{{ $competition->reportback->reportback_items->total }}</td>\n+                                    <td class=\"table__cell\">{{ $competition->reportback->quantity }}</td>\n+                                    <td class=\"table__cell\">{{ format_timestamp_for_display($competition->reportback->updated_at) }}</td>\n+                                @else\n+                                    <td class=\"table__cell\">N/A</td>","path":"resources/views/users/show.blade.php","position":45,"original_position":45,"commit_id":"9a44bc4ddabdc8e6135ed4e204e2bce2af59ec7f","original_commit_id":"9a44bc4ddabdc8e6135ed4e204e2bce2af59ec7f","user":{"login":"weerd","id":105849,"avatar_url":"https://avatars.githubusercontent.com/u/105849?v=3","gravatar_id":"","url":"https://api.github.com/users/weerd","html_url":"https://github.com/weerd","followers_url":"https://api.github.com/users/weerd/followers","following_url":"https://api.github.com/users/weerd/following{/other_user}","gists_url":"https://api.github.com/users/weerd/gists{/gist_id}","starred_url":"https://api.github.com/users/weerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weerd/subscriptions","organizations_url":"https://api.github.com/users/weerd/orgs","repos_url":"https://api.github.com/users/weerd/repos","events_url":"https://api.github.com/users/weerd/events{/privacy}","received_events_url":"https://api.github.com/users/weerd/received_events","type":"User","site_admin":false},"body":"Not really because it needs to check for nested properties of the reportback object if the `$competition->reportback` object exists. There's no way to easily use `or` if it's not the direct item you're looking for.\r\n\r\nSo say if I did this:\r\n```php\r\n$competition->reportback->quantity or 'NA'\r\n```\r\n\r\nIf `$competition->reportback` was `null` to begin with I believe it would fail cause then it's trying to get a `quantity` property on `null`.","created_at":"2016-04-19T21:03:42Z","updated_at":"2016-04-19T21:03:42Z","html_url":"https://github.com/DoSomething/gladiator/pull/231#discussion_r60310839","pull_request_url":"https://api.github.com/repos/DoSomething/gladiator/pulls/231","_links":{"self":{"href":"https://api.github.com/repos/DoSomething/gladiator/pulls/comments/60310839"},"html":{"href":"https://github.com/DoSomething/gladiator/pull/231#discussion_r60310839"},"pull_request":{"href":"https://api.github.com/repos/DoSomething/gladiator/pulls/231"}}},"pull_request":{"url":"https://api.github.com/repos/DoSomething/gladiator/pulls/231","id":67080852,"html_url":"https://github.com/DoSomething/gladiator/pull/231","diff_url":"https://github.com/DoSomething/gladiator/pull/231.diff","patch_url":"https://github.com/DoSomething/gladiator/pull/231.patch","issue_url":"https://api.github.com/repos/DoSomething/gladiator/issues/231","number":231,"state":"open","locked":false,"title":"Updates to fix showing User activity on single user show page.","user":{"login":"weerd","id":105849,"avatar_url":"https://avatars.githubusercontent.com/u/105849?v=3","gravatar_id":"","url":"https://api.github.com/users/weerd","html_url":"https://github.com/weerd","followers_url":"https://api.github.com/users/weerd/followers","following_url":"https://api.github.com/users/weerd/following{/other_user}","gists_url":"https://api.github.com/users/weerd/gists{/gist_id}","starred_url":"https://api.github.com/users/weerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weerd/subscriptions","organizations_url":"https://api.github.com/users/weerd/orgs","repos_url":"https://api.github.com/users/weerd/repos","events_url":"https://api.github.com/users/weerd/events{/privacy}","received_events_url":"https://api.github.com/users/weerd/received_events","type":"User","site_admin":false},"body":"#### What's this PR do?\r\nThis PR fixes an error with a missing function call that was introduced after #224 was merged. This cleans up and fixes that issue using a similar approach as some of the other methods in the `Manager` class. It also adds a few helpful helper functions.\r\n\r\n#### How should this be manually tested?\r\nLoad a competition with users, click on a user to view their individual page, and see if their user activity is displayed for the competition with Reportbacks (if any), etc.\r\n\r\n#### What are the relevant tickets?\r\nFixes #227\r\n\r\n---\r\n@DoSomething/gladiator \r\n","created_at":"2016-04-19T20:06:50Z","updated_at":"2016-04-19T21:03:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e80d0e8a2f5f57dc1f0310526f02cf8e4a22d60","assignee":{"login":"angaither","id":645205,"avatar_url":"https://avatars.githubusercontent.com/u/645205?v=3","gravatar_id":"","url":"https://api.github.com/users/angaither","html_url":"https://github.com/angaither","followers_url":"https://api.github.com/users/angaither/followers","following_url":"https://api.github.com/users/angaither/following{/other_user}","gists_url":"https://api.github.com/users/angaither/gists{/gist_id}","starred_url":"https://api.github.com/users/angaither/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angaither/subscriptions","organizations_url":"https://api.github.com/users/angaither/orgs","repos_url":"https://api.github.com/users/angaither/repos","events_url":"https://api.github.com/users/angaither/events{/privacy}","received_events_url":"https://api.github.com/users/angaither/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/DoSomething/gladiator/pulls/231/commits","review_comments_url":"https://api.github.com/repos/DoSomething/gladiator/pulls/231/comments","review_comment_url":"https://api.github.com/repos/DoSomething/gladiator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DoSomething/gladiator/issues/231/comments","statuses_url":"https://api.github.com/repos/DoSomething/gladiator/statuses/9a44bc4ddabdc8e6135ed4e204e2bce2af59ec7f","head":{"label":"DoSomething:user-show-reportback-activity-fix","ref":"user-show-reportback-activity-fix","sha":"9a44bc4ddabdc8e6135ed4e204e2bce2af59ec7f","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":51176505,"name":"gladiator","full_name":"DoSomething/gladiator","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/gladiator","description":"The DoSomething.org Competitions Platform","fork":false,"url":"https://api.github.com/repos/DoSomething/gladiator","forks_url":"https://api.github.com/repos/DoSomething/gladiator/forks","keys_url":"https://api.github.com/repos/DoSomething/gladiator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/gladiator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/gladiator/teams","hooks_url":"https://api.github.com/repos/DoSomething/gladiator/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/gladiator/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/gladiator/events","assignees_url":"https://api.github.com/repos/DoSomething/gladiator/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/gladiator/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/gladiator/tags","blobs_url":"https://api.github.com/repos/DoSomething/gladiator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/gladiator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/gladiator/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/gladiator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/gladiator/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/gladiator/languages","stargazers_url":"https://api.github.com/repos/DoSomething/gladiator/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/gladiator/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/gladiator/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/gladiator/subscription","commits_url":"https://api.github.com/repos/DoSomething/gladiator/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/gladiator/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/gladiator/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/gladiator/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/gladiator/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/gladiator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/gladiator/merges","archive_url":"https://api.github.com/repos/DoSomething/gladiator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/gladiator/downloads","issues_url":"https://api.github.com/repos/DoSomething/gladiator/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/gladiator/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/gladiator/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/gladiator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/gladiator/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/gladiator/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/gladiator/deployments","created_at":"2016-02-05T21:53:32Z","updated_at":"2016-02-05T22:11:13Z","pushed_at":"2016-04-19T20:10:34Z","git_url":"git://github.com/DoSomething/gladiator.git","ssh_url":"git@github.com:DoSomething/gladiator.git","clone_url":"https://github.com/DoSomething/gladiator.git","svn_url":"https://github.com/DoSomething/gladiator","homepage":null,"size":673,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":26,"forks":1,"open_issues":26,"watchers":0,"default_branch":"master"}},"base":{"label":"DoSomething:master","ref":"master","sha":"0bbb2ee46040afa9899477ca16f40dad5d658323","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":51176505,"name":"gladiator","full_name":"DoSomething/gladiator","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/gladiator","description":"The DoSomething.org Competitions Platform","fork":false,"url":"https://api.github.com/repos/DoSomething/gladiator","forks_url":"https://api.github.com/repos/DoSomething/gladiator/forks","keys_url":"https://api.github.com/repos/DoSomething/gladiator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/gladiator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/gladiator/teams","hooks_url":"https://api.github.com/repos/DoSomething/gladiator/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/gladiator/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/gladiator/events","assignees_url":"https://api.github.com/repos/DoSomething/gladiator/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/gladiator/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/gladiator/tags","blobs_url":"https://api.github.com/repos/DoSomething/gladiator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/gladiator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/gladiator/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/gladiator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/gladiator/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/gladiator/languages","stargazers_url":"https://api.github.com/repos/DoSomething/gladiator/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/gladiator/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/gladiator/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/gladiator/subscription","commits_url":"https://api.github.com/repos/DoSomething/gladiator/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/gladiator/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/gladiator/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/gladiator/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/gladiator/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/gladiator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/gladiator/merges","archive_url":"https://api.github.com/repos/DoSomething/gladiator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/gladiator/downloads","issues_url":"https://api.github.com/repos/DoSomething/gladiator/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/gladiator/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/gladiator/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/gladiator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/gladiator/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/gladiator/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/gladiator/deployments","created_at":"2016-02-05T21:53:32Z","updated_at":"2016-02-05T22:11:13Z","pushed_at":"2016-04-19T20:10:34Z","git_url":"git://github.com/DoSomething/gladiator.git","ssh_url":"git@github.com:DoSomething/gladiator.git","clone_url":"https://github.com/DoSomething/gladiator.git","svn_url":"https://github.com/DoSomething/gladiator","homepage":null,"size":673,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":26,"forks":1,"open_issues":26,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DoSomething/gladiator/pulls/231"},"html":{"href":"https://github.com/DoSomething/gladiator/pull/231"},"issue":{"href":"https://api.github.com/repos/DoSomething/gladiator/issues/231"},"comments":{"href":"https://api.github.com/repos/DoSomething/gladiator/issues/231/comments"},"review_comments":{"href":"https://api.github.com/repos/DoSomething/gladiator/pulls/231/comments"},"review_comment":{"href":"https://api.github.com/repos/DoSomething/gladiator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DoSomething/gladiator/pulls/231/commits"},"statuses":{"href":"https://api.github.com/repos/DoSomething/gladiator/statuses/9a44bc4ddabdc8e6135ed4e204e2bce2af59ec7f"}}}}