You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Fixrails#54560
- `update_all` would produce a broken query when using more than one
JOIN on the target.
```ruby
Developer.join(:computer, :mentor).update_all(ready: true)
```
Before
```sql
UPDATE developers SET ready = true FROM computers JOIN mentors on mentors.id = developers.mentor_id WHERE developer.computer_id = computer.id;
# We can't make a JOIN on the developer table, this should in the FROM clause.
```
After
```sql
UPDATE developers SET ready = true FROM computers, mentors WHERE developer.computer_id = computer.id AND developers.mentor_id = mentors.id;
```
0 commit comments