{"action":"created","issue":{"url":"https://api.github.com/repos/hyperloop-rails/static-checker/issues/2","repository_url":"https://api.github.com/repos/hyperloop-rails/static-checker","labels_url":"https://api.github.com/repos/hyperloop-rails/static-checker/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/hyperloop-rails/static-checker/issues/2/comments","events_url":"https://api.github.com/repos/hyperloop-rails/static-checker/issues/2/events","html_url":"https://github.com/hyperloop-rails/static-checker/issues/2","id":336646164,"node_id":"MDU6SXNzdWUzMzY2NDYxNjQ=","number":2,"title":"Still relevant to check `any?` & `where.first` ?","user":{"login":"itsderek23","id":7880,"node_id":"MDQ6VXNlcjc4ODA=","avatar_url":"https://avatars2.githubusercontent.com/u/7880?v=4","gravatar_id":"","url":"https://api.github.com/users/itsderek23","html_url":"https://github.com/itsderek23","followers_url":"https://api.github.com/users/itsderek23/followers","following_url":"https://api.github.com/users/itsderek23/following{/other_user}","gists_url":"https://api.github.com/users/itsderek23/gists{/gist_id}","starred_url":"https://api.github.com/users/itsderek23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itsderek23/subscriptions","organizations_url":"https://api.github.com/users/itsderek23/orgs","repos_url":"https://api.github.com/users/itsderek23/repos","events_url":"https://api.github.com/users/itsderek23/events{/privacy}","received_events_url":"https://api.github.com/users/itsderek23/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-28T14:29:23Z","updated_at":"2018-06-28T20:16:57Z","closed_at":null,"author_association":"NONE","body":"I believe more current versions of ActiveRecord address this. Notice that AR is using `LIMIT 1` and isn't loading the result set into memory.\r\n\r\n```\r\nirb(main):007:0> User.where(email: 'email').exists?\r\n  User Exists (1.0ms)  SELECT  1 AS one FROM `users` WHERE `users`.`email` = 'email' LIMIT 1\r\n=> false\r\nirb(main):008:0> User.where(email: 'email').any?\r\n  User Exists (0.4ms)  SELECT  1 AS one FROM `users` WHERE `users`.`email` = 'email' LIMIT 1\r\n=> false\r\nirb(main):009:0> User.find_by(email: 'email')\r\n  User Load (0.4ms)  SELECT  `users`.* FROM `users` WHERE `users`.`email` = 'email' LIMIT 1\r\n=> nil\r\nirb(main):010:0> User.where(email: 'email').first\r\n  User Load (0.5ms)  SELECT  `users`.* FROM `users` WHERE `users`.`email` = 'email' ORDER BY `users`.`id` ASC LIMIT 1\r\n=> nil\r\n```\r\n\r\nCredit to @mccallumjack."},"comment":{"url":"https://api.github.com/repos/hyperloop-rails/static-checker/issues/comments/401159864","html_url":"https://github.com/hyperloop-rails/static-checker/issues/2#issuecomment-401159864","issue_url":"https://api.github.com/repos/hyperloop-rails/static-checker/issues/2","id":401159864,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTE1OTg2NA==","user":{"login":"graingert","id":413772,"node_id":"MDQ6VXNlcjQxMzc3Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/413772?v=4","gravatar_id":"","url":"https://api.github.com/users/graingert","html_url":"https://github.com/graingert","followers_url":"https://api.github.com/users/graingert/followers","following_url":"https://api.github.com/users/graingert/following{/other_user}","gists_url":"https://api.github.com/users/graingert/gists{/gist_id}","starred_url":"https://api.github.com/users/graingert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graingert/subscriptions","organizations_url":"https://api.github.com/users/graingert/orgs","repos_url":"https://api.github.com/users/graingert/repos","events_url":"https://api.github.com/users/graingert/events{/privacy}","received_events_url":"https://api.github.com/users/graingert/received_events","type":"User","site_admin":false},"created_at":"2018-06-28T20:16:57Z","updated_at":"2018-06-28T20:16:57Z","author_association":"NONE","body":"Sorry I don't understand what you're saying"}}
{"actor":{"display_login":"graingert"}}