I know what your problem is. If because of changes to Rails reconnecting to the db by using the old connection doesn’t work, then I suggested that you give up on using the old connection and just instruct AR to connect as if the application was just booting up. Have you tried what I suggested at all? Are you having the same problem?
Thanks Mislav, I tried your suggestion, but it doesn’t work.
My actual problem is not about restoring the connection (but thanks for the tip, I may need it eventually).
It is about the fact that I always get exception when I’m trying to access model attributes when connection was removed with remove_connection (i.e. I get exception in the yield part).
BTW, have you tried your helper on Rails 3.1.1?