Cassius Rosenthal on 20 Feb 2006 04:18:43 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PhillyOnRails] Initialize ActiveRecord w/o a database.


Adam, thanks for the response.

Taken out of context, my question doesn't sound so complicated. The question revolves around how to initialize ActiveRecord, not the connection. From my previous post:
I tried leaving 'database.yml' blank and I tried disabling ActiveRecord's initialization. Both cause runtime errors in the app, as it tries to cache relationships I guess.
Yes; I would like to establish a new connection using "ActiveRecord::Base#establish_connection." I can't, because the entire stack dies first, because ActiveRecord is trying to connect to 'config/database.yml.'

-Cassius




Adam C. Greenfield wrote:
On 2/19/06, Cassius Rosenthal <cassius@xmodulation.com> wrote:
The question: Does anybody have an idea of how to initialize
ActiveRecord on-the-fly, without using the config/database.yml' convention?

Your looking for ActiveRecord::Base#establish_connection I suspect: http://railsmanual.org/class/ActiveRecord%3A%3ABase/establish_connection _______________________________________________ talk mailing list talk@phillyonrails.org http://lists.phillyonrails.org/mailman/listinfo/talk




_______________________________________________ talk mailing list talk@phillyonrails.org http://lists.phillyonrails.org/mailman/listinfo/talk