Displaying 1 result from an estimated 1 matches for "_dbname".
Did you mean:
dbname
2006 Mar 27
5
Accessing Session Object from a model
...ged 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 :database attribute, but I can''t figure out any way to
pass this information into the model before the connection takes place.
Any help or ideas woul...