rails/rails — pull request #15071 by leafac (2014-05-12 16:04:37+00:00)
Title: Fix `Relation#delete_all` inconsistency

When relation scopes include one of `uniq`, `group`, `having` or
`offset`, the generated query ignores them and that causes unintended
records to be deleted. This solves the issue by restricting the deletion
when those scopes are present.

rails/rails#11985