{"action":"created","issue":{"url":"https://api.github.com/repos/zendesk/samson/issues/1291","repository_url":"https://api.github.com/repos/zendesk/samson","labels_url":"https://api.github.com/repos/zendesk/samson/issues/1291/labels{/name}","comments_url":"https://api.github.com/repos/zendesk/samson/issues/1291/comments","events_url":"https://api.github.com/repos/zendesk/samson/issues/1291/events","html_url":"https://github.com/zendesk/samson/pull/1291","id":177937134,"number":1291,"title":"correctly fetch data when it is an ActionController::Parameters object","user":{"login":"anthonywoo","id":1566114,"avatar_url":"https://avatars.githubusercontent.com/u/1566114?v=3","gravatar_id":"","url":"https://api.github.com/users/anthonywoo","html_url":"https://github.com/anthonywoo","followers_url":"https://api.github.com/users/anthonywoo/followers","following_url":"https://api.github.com/users/anthonywoo/following{/other_user}","gists_url":"https://api.github.com/users/anthonywoo/gists{/gist_id}","starred_url":"https://api.github.com/users/anthonywoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthonywoo/subscriptions","organizations_url":"https://api.github.com/users/anthonywoo/orgs","repos_url":"https://api.github.com/users/anthonywoo/repos","events_url":"https://api.github.com/users/anthonywoo/events{/privacy}","received_events_url":"https://api.github.com/users/anthonywoo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-20T01:02:47Z","updated_at":"2016-09-20T01:07:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zendesk/samson/pulls/1291","html_url":"https://github.com/zendesk/samson/pull/1291","diff_url":"https://github.com/zendesk/samson/pull/1291.diff","patch_url":"https://github.com/zendesk/samson/pull/1291.patch"},"body":"When we moved to rails 5 - `params` is no longer a hash and is now an `ActionController::Parameters` object. Since it is now this object - when we pass in `params` to `Sawyer` (to get `@data`) it preserves the object type and calling method notation on the Sawyer resource no longer works.\r\n\r\nI tried to look into converting `params` to a hash before we create the `Sawyer` resource using `params.permit()` however - that proved to be very difficult when dealing with webhook data\r\n\r\nI am open to suggestions if anyone has a better idea on how to convert `ActionController::Parameters` to a hash\r\n\r\n\r\n/cc @zendesk/samson\r\n\r\n### Tasks\r\n - [ ] :+1: from team\r\n\r\n### References\r\n - Jira link:\r\n\r\n### Risks\r\n- Level: Low. Github Pull request Integration may still be broken...\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/zendesk/samson/issues/comments/248173712","html_url":"https://github.com/zendesk/samson/pull/1291#issuecomment-248173712","issue_url":"https://api.github.com/repos/zendesk/samson/issues/1291","id":248173712,"user":{"login":"sandlerr","id":5535625,"avatar_url":"https://avatars.githubusercontent.com/u/5535625?v=3","gravatar_id":"","url":"https://api.github.com/users/sandlerr","html_url":"https://github.com/sandlerr","followers_url":"https://api.github.com/users/sandlerr/followers","following_url":"https://api.github.com/users/sandlerr/following{/other_user}","gists_url":"https://api.github.com/users/sandlerr/gists{/gist_id}","starred_url":"https://api.github.com/users/sandlerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandlerr/subscriptions","organizations_url":"https://api.github.com/users/sandlerr/orgs","repos_url":"https://api.github.com/users/sandlerr/repos","events_url":"https://api.github.com/users/sandlerr/events{/privacy}","received_events_url":"https://api.github.com/users/sandlerr/received_events","type":"User","site_admin":false},"created_at":"2016-09-20T01:07:37Z","updated_at":"2016-09-20T01:07:37Z","body":"> I am open to suggestions if anyone has a better idea on how to convert `ActionController::Parameters` to a hash\r\n\r\nWould this be suitable? http://api.rubyonrails.org/classes/ActionController/Parameters.html#method-i-to_h"}}
{"actor":{"display_login":"sandlerr"}}