This is a rails bug. I tracked it down and submitted a PR to solve the problem https://github.com/rails/rails/pull/8701
I think we can merge it in in the near future. I'll try to backport the patch to 3-2-stable
so that it will be available in the next 3.2.x
release.
EDIT: PR is merged into rails/master and rails/3-2-stable. Sadly a little to lait for 3.2.10, need to wait for the next release ;).