rails/rails — pull request #8449 by derekkraan (2012-12-07 12:28:09+00:00)
Title: Fix update_all() with default_scope with joins().where(condition_on_joined_table)

There was a bug where you could use `Model.joins(...).where(condition_on_joined_table).update_all(...)`, but the equivalent with a default scope didn't work. Basically, AR was using the where clause but not bothering to join the table, resulting in SQL errors.

After I fixed that, I found another bug where using `update_all()` on an ambiguous column name (in the mysql adaptor) resulted in more SQL errors. So I reproduced that in a test and fixed it too.

Feedback welcome. Let me know if it's unclear what I'm trying to do with the tests that I wrote.