rails/rails — pull request #16652 by DanOlson (2014-08-23 03:16:50+00:00)
Title: Don't run a query if it can't return any results

Fixes #16506

Don't make a trip to the database if a query's WHERE clause ensures it would return zero results. For example:

```
```