patch for ticket #8531

Can we apply this patch to the core?

http://dev.rubyonrails.org/ticket/8531

If not, Can someone review the patch and approve or comment?