For some reason this fills me with excitement.
I don't know exactly what's going wrong, so I'm not looking forward to building a test case for it at all, but here's the change I had to make.
I actually suspect the bug in Rails is only visible to me at all because of more serious bugs in my app, but hey, what can you do. Also -- and this is probably a related issue -- the bug seems very difficult to reproduce. (I've reproduced it, but not predictably.)