I''m trying to use two database -- one for each of my (productized)
rails sites
and one shared by all of them (containing domain tables, user tables, etc). Per
the wiki, I changed environment.rb to:
site_db = {''development'' =>
{''database'' => SITE, ...}}
ActiveRecord::Base.configurations = site_db
ActiveRecord::Base.establish_connection site_db[RAILS_ENV]
rails_db = {''development'' =>
{''database'' => ''rails'', ...}}
User.configurations = rails_db
User.establish_connection rails_db[RAILS_ENV]
Running under WEBrick, this works fine, but only on the first request. After
that, I get "Table ''site.users'' doesn''t
exist". It''s like all configurations
get reset between request. Or am I doing something wrong?
-- Steve