{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/3614","repository_url":"https://api.github.com/repos/bbatsov/rubocop","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/3614/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/3614/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/3614/events","html_url":"https://github.com/bbatsov/rubocop/issues/3614","id":182913459,"number":3614,"title":"VariableForce : undefined method `[]' for #<Enumerator: \"params\":chars>","user":{"login":"mullermp","id":9288558,"avatar_url":"https://avatars.githubusercontent.com/u/9288558?v=3","gravatar_id":"","url":"https://api.github.com/users/mullermp","html_url":"https://github.com/mullermp","followers_url":"https://api.github.com/users/mullermp/followers","following_url":"https://api.github.com/users/mullermp/following{/other_user}","gists_url":"https://api.github.com/users/mullermp/gists{/gist_id}","starred_url":"https://api.github.com/users/mullermp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mullermp/subscriptions","organizations_url":"https://api.github.com/users/mullermp/orgs","repos_url":"https://api.github.com/users/mullermp/repos","events_url":"https://api.github.com/users/mullermp/events{/privacy}","received_events_url":"https://api.github.com/users/mullermp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-13T21:55:08Z","updated_at":"2016-10-14T17:17:15Z","closed_at":null,"body":"While trying to access \"params\" or the \"request\" hash in a Rails controller method, Rubocop fails with:\r\n\r\n```\r\nAn error occurred while VariableForce cop was inspecting /my/project/path/my_controller.rb.\r\nundefined method `[]' for #<Enumerator: \"params\":chars>\r\n```\r\n\r\nCommenting out some code (shown below), I can get Rubocop to pass:\r\n\r\n    requests = params[:fraud_information].split(/\\r?\\n/)\r\n    notes = params[:notes]\r\n\r\n--------\r\n\r\n## Expected behavior\r\n\r\nRubocop should pass. It is legal to access a hash with a symbol.\r\n\r\n## Actual behavior\r\n\r\nRubocop fails, as shown above, and prints an error while inspecting.\r\n\r\n## Steps to reproduce the problem\r\n\r\nCreate a controller that a view can POST to, and then try to access the parameters with a symbol.\r\n\r\n## RuboCop version\r\n\r\n0.42.0 (using Parser 2.3.1.2, running on ruby 1.9.3 x86_64-linux)\r\n"},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/253864541","html_url":"https://github.com/bbatsov/rubocop/issues/3614#issuecomment-253864541","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/3614","id":253864541,"user":{"login":"savef","id":6241279,"avatar_url":"https://avatars.githubusercontent.com/u/6241279?v=3","gravatar_id":"","url":"https://api.github.com/users/savef","html_url":"https://github.com/savef","followers_url":"https://api.github.com/users/savef/followers","following_url":"https://api.github.com/users/savef/following{/other_user}","gists_url":"https://api.github.com/users/savef/gists{/gist_id}","starred_url":"https://api.github.com/users/savef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savef/subscriptions","organizations_url":"https://api.github.com/users/savef/orgs","repos_url":"https://api.github.com/users/savef/repos","events_url":"https://api.github.com/users/savef/events{/privacy}","received_events_url":"https://api.github.com/users/savef/received_events","type":"User","site_admin":false},"created_at":"2016-10-14T17:17:15Z","updated_at":"2016-10-14T17:17:15Z","body":"Ah! I just noticed you're on Ruby 1.9, support for that was dropped in `v0.42.0`, see [the CHANGELOG](https://github.com/bbatsov/rubocop/blob/a644414536a7715e1aecf247edf9fdad963e2ee6/CHANGELOG.md#changes-2)."}}
{"actor":{"display_login":"savef"}}