Rafael, I think you're right, the line above also needs to be fixed.

I just added a [pull request](https://github.com/rails/rails/pull/9541) with that change and a new test.