{"action":"created","issue":{"url":"https://api.github.com/repos/OggimusPrime/BlocMetrics-API/issues/7","labels_url":"https://api.github.com/repos/OggimusPrime/BlocMetrics-API/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/OggimusPrime/BlocMetrics-API/issues/7/comments","events_url":"https://api.github.com/repos/OggimusPrime/BlocMetrics-API/issues/7/events","html_url":"https://github.com/OggimusPrime/BlocMetrics-API/pull/7","id":72510768,"number":7,"title":"[FIX] Finding the proper App when creating an event","user":{"login":"chikamichi","id":106689,"avatar_url":"https://avatars.githubusercontent.com/u/106689?v=3","gravatar_id":"","url":"https://api.github.com/users/chikamichi","html_url":"https://github.com/chikamichi","followers_url":"https://api.github.com/users/chikamichi/followers","following_url":"https://api.github.com/users/chikamichi/following{/other_user}","gists_url":"https://api.github.com/users/chikamichi/gists{/gist_id}","starred_url":"https://api.github.com/users/chikamichi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chikamichi/subscriptions","organizations_url":"https://api.github.com/users/chikamichi/orgs","repos_url":"https://api.github.com/users/chikamichi/repos","events_url":"https://api.github.com/users/chikamichi/events{/privacy}","received_events_url":"https://api.github.com/users/chikamichi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-01T20:07:30Z","updated_at":"2015-05-01T20:27:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OggimusPrime/BlocMetrics-API/pulls/7","html_url":"https://github.com/OggimusPrime/BlocMetrics-API/pull/7","diff_url":"https://github.com/OggimusPrime/BlocMetrics-API/pull/7.diff","patch_url":"https://github.com/OggimusPrime/BlocMetrics-API/pull/7.patch"},"body":"There, I am using `params[:app_id]` to find the `App` I want to register an event for. That `:app_id` is reliable, because it comes from the url itself (see routes: http://localhost:3001/apps/:app_id/events) and it will only be used to *find* something in the database, not for updating content.\r\n\r\nThe data describing the event to create must be filtered using StrongParameters (`require`/`permit`), because that has been provided as the payload of the POST request and thus should not be blindly whitelisted as a whole. One may also add a validation layer on the `Event` model to further constrain the creation/edit operations, ensuring the content of the whitelisted keys is OK to go with."},"comment":{"url":"https://api.github.com/repos/OggimusPrime/BlocMetrics-API/issues/comments/98227106","html_url":"https://github.com/OggimusPrime/BlocMetrics-API/pull/7#issuecomment-98227106","issue_url":"https://api.github.com/repos/OggimusPrime/BlocMetrics-API/issues/7","id":98227106,"user":{"login":"chikamichi","id":106689,"avatar_url":"https://avatars.githubusercontent.com/u/106689?v=3","gravatar_id":"","url":"https://api.github.com/users/chikamichi","html_url":"https://github.com/chikamichi","followers_url":"https://api.github.com/users/chikamichi/followers","following_url":"https://api.github.com/users/chikamichi/following{/other_user}","gists_url":"https://api.github.com/users/chikamichi/gists{/gist_id}","starred_url":"https://api.github.com/users/chikamichi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chikamichi/subscriptions","organizations_url":"https://api.github.com/users/chikamichi/orgs","repos_url":"https://api.github.com/users/chikamichi/repos","events_url":"https://api.github.com/users/chikamichi/events{/privacy}","received_events_url":"https://api.github.com/users/chikamichi/received_events","type":"User","site_admin":false},"created_at":"2015-05-01T20:27:00Z","updated_at":"2015-05-01T20:27:00Z","body":"*Btw, it is passing when using my little edit, as shown in this Pull Request.*"}}