set_table_name on the fly

Hi. I have a model that connects to a database, does something, connects to a different database, does something, and so on.

The switching of the databases appears to work, as calling:

MyModel.connection.instance_eval { @config[:database] }

Yields the correct database.

After changing databases I also call:

set_table_name('new_table_name')

However, upon issuing a query:

User.find(:all)

I receive an error similar to:

Unknown column 'old_table_name.column' in 'where clause'...

Any ideas?