[3.0+AR3.1] Backport broken where merge fix

Backporting #60 into the `3-0-github+ar-3-1` branch.

cc @github/rails @github/rails3