alphagov/whitehall — pull request #20 by bradleywright (2012-08-08 14:20:49+00:00)
Title: Don't use a single JOIN to bring in foreign key records

By using a single JOIN we were only including organisations that matched the
query, rather than returning all of them. This makes the join explicit with
an EXISTS clause.

https://www.pivotaltracker.com/story/show/34009669

Specifically I need feedback on:

- Whether the explicit hard-coded table name is alright; and
- What/where I should be testing, given all the tests seem to be stubs.