{"comment":{"url":"https://api.github.com/repos/Peterortiz82/TIY-Catalog/comments/9978825","html_url":"https://github.com/Peterortiz82/TIY-Catalog/commit/83132c5f656ad79634ac53e624de92e0aea9c0e8#commitcomment-9978825","id":9978825,"user":{"login":"bgates","id":381787,"avatar_url":"https://avatars.githubusercontent.com/u/381787?v=3","gravatar_id":"","url":"https://api.github.com/users/bgates","html_url":"https://github.com/bgates","followers_url":"https://api.github.com/users/bgates/followers","following_url":"https://api.github.com/users/bgates/following{/other_user}","gists_url":"https://api.github.com/users/bgates/gists{/gist_id}","starred_url":"https://api.github.com/users/bgates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgates/subscriptions","organizations_url":"https://api.github.com/users/bgates/orgs","repos_url":"https://api.github.com/users/bgates/repos","events_url":"https://api.github.com/users/bgates/events{/privacy}","received_events_url":"https://api.github.com/users/bgates/received_events","type":"User","site_admin":false},"position":14,"line":17,"path":"rails/etsy_product_catalog/app/controllers/sessions_controller.rb","commit_id":"83132c5f656ad79634ac53e624de92e0aea9c0e8","created_at":"2015-03-02T04:10:33Z","updated_at":"2015-03-02T04:10:33Z","body":"You should look for the user in the db, but also be prepared to create a new one if that doesn't work. Your existing code always creates one, after which looks in the db, at which point it's guaranteed to find the user that just got created."}}