Displaying 1 result from an estimated 1 matches for "db_adaptor".
Did you mean:
db_adapter
2006 Mar 27
5
Accessing Session Object from a model
...it''s a requirement of the project so i''m stuck with it.
I need to be able to tell my model what DB to connect to based on what
profile the logged in user has. Something similar to:
[code]
class Report < ActiveRecord::Base
establish_connection({
:adapter => MyConfig.config(:db_adaptor),
:username => MyConfig.config(:db_user_name),
:password => MyConfig.config(:db_password),
:database => @session[:user].profile.name + "_dbname"
})
set_table_name "reports"
.
.
.
end
All the DBs have the same login information so the only thing I need to
change is the...