rails/rails — pull request #16309 by exviva (2014-07-27 11:30:39+00:00)
Title: Expose bug in HMT assocation delete_all with a where clause

[Do not merge]

I've found this bug in AR that adding `where` between a HMT association and `delete_all` changes the behaviour dangerously - `DELETE` is fired on the source table, not on the join table.

For now I could just reproduce it in a test case, I'd be happy to work on a fix, but I'd need some directions.