laravel/laravel — pull request #1055 by franzliedke (2012-08-03 16:33:05+00:00)
Title: Handle empty arrays in where_in() gracefully

BAM! This finally fixes #638.

This makes sure that empty arrays passed to where_in() return an empty result set (empty array for SELECT queries, `0` for UPDATE and DELETE).

I believe this is the kind of graceful handling of empty arrays we should have for empty arrays in IN clauses.

---
Regarding #638: there is a difference in how to handle `WHERE IN` and `WHERE NOT IN`. Doing the latter with an empty array obviously means that the condition doesn't exclude any rows, thus it is ignored.