{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/2547","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2547/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2547/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2547/events","html_url":"https://github.com/bbatsov/rubocop/issues/2547","id":124107980,"number":2547,"title":"Mongoid select first incorrectly auto corrected to find","user":{"login":"TLmaK0","id":399935,"avatar_url":"https://avatars.githubusercontent.com/u/399935?v=3","gravatar_id":"","url":"https://api.github.com/users/TLmaK0","html_url":"https://github.com/TLmaK0","followers_url":"https://api.github.com/users/TLmaK0/followers","following_url":"https://api.github.com/users/TLmaK0/following{/other_user}","gists_url":"https://api.github.com/users/TLmaK0/gists{/gist_id}","starred_url":"https://api.github.com/users/TLmaK0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TLmaK0/subscriptions","organizations_url":"https://api.github.com/users/TLmaK0/orgs","repos_url":"https://api.github.com/users/TLmaK0/repos","events_url":"https://api.github.com/users/TLmaK0/events{/privacy}","received_events_url":"https://api.github.com/users/TLmaK0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-28T19:01:02Z","updated_at":"2015-12-28T20:05:28Z","closed_at":null,"body":"Mongoid returns criteria instead of Array.\r\n\r\nRubocop --auto-correct replaces:\r\n```Order.all.select { |order| order.closed }.first```\r\nby\r\n```Order.all.find { |order| order.closed }```\r\nbut mongoid tries to execute find on criteria so returns nil\r\n"},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/167643611","html_url":"https://github.com/bbatsov/rubocop/issues/2547#issuecomment-167643611","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2547","id":167643611,"user":{"login":"alexdowad","id":1067359,"avatar_url":"https://avatars.githubusercontent.com/u/1067359?v=3","gravatar_id":"","url":"https://api.github.com/users/alexdowad","html_url":"https://github.com/alexdowad","followers_url":"https://api.github.com/users/alexdowad/followers","following_url":"https://api.github.com/users/alexdowad/following{/other_user}","gists_url":"https://api.github.com/users/alexdowad/gists{/gist_id}","starred_url":"https://api.github.com/users/alexdowad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexdowad/subscriptions","organizations_url":"https://api.github.com/users/alexdowad/orgs","repos_url":"https://api.github.com/users/alexdowad/repos","events_url":"https://api.github.com/users/alexdowad/events{/privacy}","received_events_url":"https://api.github.com/users/alexdowad/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T20:05:28Z","updated_at":"2015-12-28T20:05:28Z","body":"> Is there a way to disable only this check by config?\r\n\r\nDefinitely there is.\r\n\r\nIt looks like the cop at work here is `Performance/Detect` (you can confirm by running with `-D`). So in `.rubocop.yml`, you can put:\r\n\r\n```\r\nPerformance/Detect:\r\n  Enabled: false\r\n```"}}