I just send a new pull request. You can see it here :
https://github.com/rails/rails/pull/7189. I don't know if there is a
better way to do what I want but it's the solution I found.
Can you check it please?
Keep up to date with Rails on Twitter and This Week in Rails
Policies: Conduct, License, Maintenance, Security, Trademarks