{"action":"closed","issue":{"url":"https://api.github.com/repos/rails/rails/issues/22528","labels_url":"https://api.github.com/repos/rails/rails/issues/22528/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/22528/comments","events_url":"https://api.github.com/repos/rails/rails/issues/22528/events","html_url":"https://github.com/rails/rails/issues/22528","id":120892153,"number":22528,"title":"Left outer join not working","user":{"login":"victorhazbun87","id":1174604,"avatar_url":"https://avatars.githubusercontent.com/u/1174604?v=3","gravatar_id":"","url":"https://api.github.com/users/victorhazbun87","html_url":"https://github.com/victorhazbun87","followers_url":"https://api.github.com/users/victorhazbun87/followers","following_url":"https://api.github.com/users/victorhazbun87/following{/other_user}","gists_url":"https://api.github.com/users/victorhazbun87/gists{/gist_id}","starred_url":"https://api.github.com/users/victorhazbun87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victorhazbun87/subscriptions","organizations_url":"https://api.github.com/users/victorhazbun87/orgs","repos_url":"https://api.github.com/users/victorhazbun87/repos","events_url":"https://api.github.com/users/victorhazbun87/events{/privacy}","received_events_url":"https://api.github.com/users/victorhazbun87/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-07T23:16:20Z","updated_at":"2015-12-07T23:34:35Z","closed_at":"2015-12-07T23:34:35Z","body":"Hello,\r\n\r\nI have 2 tables: appointments and doors. Door has one appointment and appointment belongs to a door. The appointments table have the door_id.\r\n\r\nThe query I wrote is:\r\n\r\n    scope :not_in_appointments, -> { joins(\"left outer join appointments on appointments.door_id = doors.id\") }\r\n\r\nISSUE: The scope is still returning the doors that are in the appointments table.\r\n\r\nGOAL: We want to get doors that are NOT in the appointments table.\r\n\r\nThe left outer join is suppose to do that. Can someone please let us know why this query is not working?\r\n\r\n\r\nThanks."}}