I have a separate DB for one model in my application and in development
mode the connection is working properly, in production however it isn’t.
The model that connects to the other database is called User but the
table it references in other_db is smf_users so my User.rb looks like
class User < ActiveRecord::Base
In production I’m getting this error:
Mysql::Error: Table ‘production_db. smf_users’ doesn’t exist:
Note how it is trying to connect to the wrong database and so isn’t
finding the correct table. As I say, this works in development mode.