{"action":"created","comment":{"url":"https://api.github.com/repos/DoSomething/rogue/pulls/comments/184133321","pull_request_review_id":115266098,"id":184133321,"diff_hunk":"@@ -121,7 +121,8 @@ public function show(Request $request, Signup $signup)\n     {\n         // Only allow an admin or the user who owns the signup to see the signup's unapproved posts.\n         if ($request->query('include') === 'posts') {\n-            $signup = Signup::withVisiblePosts()->first();\n+            $signups = Signup::withVisiblePosts()->get();","path":"app/Http/Controllers/SignupsController.php","position":5,"original_position":5,"commit_id":"4c6b489c5ce5f56cbeefee26294c85a3274b5ecc","original_commit_id":"75035db599a95bdc7aa7426d9ac657aac445e296","user":{"login":"chloealee","id":9019452,"avatar_url":"https://avatars2.githubusercontent.com/u/9019452?v=4","gravatar_id":"","url":"https://api.github.com/users/chloealee","html_url":"https://github.com/chloealee","followers_url":"https://api.github.com/users/chloealee/followers","following_url":"https://api.github.com/users/chloealee/following{/other_user}","gists_url":"https://api.github.com/users/chloealee/gists{/gist_id}","starred_url":"https://api.github.com/users/chloealee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chloealee/subscriptions","organizations_url":"https://api.github.com/users/chloealee/orgs","repos_url":"https://api.github.com/users/chloealee/repos","events_url":"https://api.github.com/users/chloealee/events{/privacy}","received_events_url":"https://api.github.com/users/chloealee/received_events","type":"User","site_admin":false},"body":"@katiecrane yup! I wanted to still use this scope logic instead of recreating (thought it would get a little messy). Scopes return collections so we'll have to filter this more to grab the one signup we want.","created_at":"2018-04-25T16:54:15Z","updated_at":"2018-04-25T16:54:15Z","html_url":"https://github.com/DoSomething/rogue/pull/689#discussion_r184133321","pull_request_url":"https://api.github.com/repos/DoSomething/rogue/pulls/689","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DoSomething/rogue/pulls/comments/184133321"},"html":{"href":"https://github.com/DoSomething/rogue/pull/689#discussion_r184133321"},"pull_request":{"href":"https://api.github.com/repos/DoSomething/rogue/pulls/689"}},"in_reply_to_id":184131743},"pull_request":{"url":"https://api.github.com/repos/DoSomething/rogue/pulls/689","id":183879751,"html_url":"https://github.com/DoSomething/rogue/pull/689","diff_url":"https://github.com/DoSomething/rogue/pull/689.diff","patch_url":"https://github.com/DoSomething/rogue/pull/689.patch","issue_url":"https://api.github.com/repos/DoSomething/rogue/issues/689","number":689,"state":"open","locked":false,"title":"v3/signups/:signup_id?include=posts bug","user":{"login":"chloealee","id":9019452,"avatar_url":"https://avatars2.githubusercontent.com/u/9019452?v=4","gravatar_id":"","url":"https://api.github.com/users/chloealee","html_url":"https://github.com/chloealee","followers_url":"https://api.github.com/users/chloealee/followers","following_url":"https://api.github.com/users/chloealee/following{/other_user}","gists_url":"https://api.github.com/users/chloealee/gists{/gist_id}","starred_url":"https://api.github.com/users/chloealee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chloealee/subscriptions","organizations_url":"https://api.github.com/users/chloealee/orgs","repos_url":"https://api.github.com/users/chloealee/repos","events_url":"https://api.github.com/users/chloealee/events{/privacy}","received_events_url":"https://api.github.com/users/chloealee/received_events","type":"User","site_admin":false},"body":"#### What's this PR do?\r\n- This PR fixes the bug when you hit `/v3/signup/:signup_id?include=posts`, it returns the incorrect signup (without the `?include=posts`, everything works fine).\r\n  - This is because `withVisiblePosts()` returns a collection and it was grabbing the first post from this collection and always returning that instead of the one specified in the endpoint! \r\n  - This fix explicitly grabs the correct signup from the collection. \r\n- Also adds tests to make sure this is returning properly!\r\n- Also fixes bug @aaronschachter pointed out that was introduced in #688 that deleting signup no longer works (we were sending `signup.signup_id` instead of `signup.id` which was changed when we changed to using v3 endpoint).\r\n\r\n#### How should this be reviewed?\r\n👀 \r\n\r\n#### Relevant tickets\r\nFixes [this](https://www.pivotaltracker.com/n/projects/2019429/stories/157064679) Pivotal Card.\r\n\r\n#### How to deploy\r\nhttps://github.com/DoSomething/rogue/blob/master/docs/development/deployments.md\r\n","created_at":"2018-04-24T22:17:41Z","updated_at":"2018-04-25T16:54:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd03954259487908e65c1df6d3465b6745bee0ff","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DoSomething/rogue/pulls/689/commits","review_comments_url":"https://api.github.com/repos/DoSomething/rogue/pulls/689/comments","review_comment_url":"https://api.github.com/repos/DoSomething/rogue/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DoSomething/rogue/issues/689/comments","statuses_url":"https://api.github.com/repos/DoSomething/rogue/statuses/4c6b489c5ce5f56cbeefee26294c85a3274b5ecc","head":{"label":"DoSomething:signup-page-bug","ref":"signup-page-bug","sha":"4c6b489c5ce5f56cbeefee26294c85a3274b5ecc","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","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":64166359,"name":"rogue","full_name":"DoSomething/rogue","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","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/rogue","description":":camera: The DoSomething.org campaign activity service.","fork":false,"url":"https://api.github.com/repos/DoSomething/rogue","forks_url":"https://api.github.com/repos/DoSomething/rogue/forks","keys_url":"https://api.github.com/repos/DoSomething/rogue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/rogue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/rogue/teams","hooks_url":"https://api.github.com/repos/DoSomething/rogue/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/rogue/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/rogue/events","assignees_url":"https://api.github.com/repos/DoSomething/rogue/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/rogue/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/rogue/tags","blobs_url":"https://api.github.com/repos/DoSomething/rogue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/rogue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/rogue/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/rogue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/rogue/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/rogue/languages","stargazers_url":"https://api.github.com/repos/DoSomething/rogue/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/rogue/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/rogue/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/rogue/subscription","commits_url":"https://api.github.com/repos/DoSomething/rogue/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/rogue/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/rogue/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/rogue/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/rogue/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/rogue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/rogue/merges","archive_url":"https://api.github.com/repos/DoSomething/rogue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/rogue/downloads","issues_url":"https://api.github.com/repos/DoSomething/rogue/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/rogue/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/rogue/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/rogue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/rogue/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/rogue/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/rogue/deployments","created_at":"2016-07-25T20:38:30Z","updated_at":"2018-04-24T19:18:29Z","pushed_at":"2018-04-25T16:52:01Z","git_url":"git://github.com/DoSomething/rogue.git","ssh_url":"git@github.com:DoSomething/rogue.git","clone_url":"https://github.com/DoSomething/rogue.git","svn_url":"https://github.com/DoSomething/rogue","homepage":"https://rogue.dosomething.org","size":4958,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":6,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"DoSomething:master","ref":"master","sha":"0b5c135dc97ebbbef9f24bdc869a76e6125c67be","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","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":64166359,"name":"rogue","full_name":"DoSomething/rogue","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","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/rogue","description":":camera: The DoSomething.org campaign activity service.","fork":false,"url":"https://api.github.com/repos/DoSomething/rogue","forks_url":"https://api.github.com/repos/DoSomething/rogue/forks","keys_url":"https://api.github.com/repos/DoSomething/rogue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/rogue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/rogue/teams","hooks_url":"https://api.github.com/repos/DoSomething/rogue/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/rogue/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/rogue/events","assignees_url":"https://api.github.com/repos/DoSomething/rogue/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/rogue/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/rogue/tags","blobs_url":"https://api.github.com/repos/DoSomething/rogue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/rogue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/rogue/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/rogue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/rogue/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/rogue/languages","stargazers_url":"https://api.github.com/repos/DoSomething/rogue/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/rogue/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/rogue/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/rogue/subscription","commits_url":"https://api.github.com/repos/DoSomething/rogue/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/rogue/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/rogue/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/rogue/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/rogue/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/rogue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/rogue/merges","archive_url":"https://api.github.com/repos/DoSomething/rogue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/rogue/downloads","issues_url":"https://api.github.com/repos/DoSomething/rogue/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/rogue/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/rogue/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/rogue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/rogue/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/rogue/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/rogue/deployments","created_at":"2016-07-25T20:38:30Z","updated_at":"2018-04-24T19:18:29Z","pushed_at":"2018-04-25T16:52:01Z","git_url":"git://github.com/DoSomething/rogue.git","ssh_url":"git@github.com:DoSomething/rogue.git","clone_url":"https://github.com/DoSomething/rogue.git","svn_url":"https://github.com/DoSomething/rogue","homepage":"https://rogue.dosomething.org","size":4958,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":6,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DoSomething/rogue/pulls/689"},"html":{"href":"https://github.com/DoSomething/rogue/pull/689"},"issue":{"href":"https://api.github.com/repos/DoSomething/rogue/issues/689"},"comments":{"href":"https://api.github.com/repos/DoSomething/rogue/issues/689/comments"},"review_comments":{"href":"https://api.github.com/repos/DoSomething/rogue/pulls/689/comments"},"review_comment":{"href":"https://api.github.com/repos/DoSomething/rogue/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DoSomething/rogue/pulls/689/commits"},"statuses":{"href":"https://api.github.com/repos/DoSomething/rogue/statuses/4c6b489c5ce5f56cbeefee26294c85a3274b5ecc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"chloealee"}}