Re: How to load the database.yml file again during runtime?

Frederick Cheung
Sat, 07 Jun 2008 20:46:25 -0000

On Jun 7, 9:33 pm, Juan Tarquino
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
> Hi, I have an application that allows the user to make changes to the
> database.yml file so that he can connect to another database. However I
> have to manually restart the application to make the changes in
> database.yml effective. My question is: is there any way of making the
> changes in database.yml effective from the application code? or at
> least, is there any way of restarting the application from the
> application code?
>
Don''t know about restarting the app (I suspect not) but
ActiveRecord::Base.establish_connection might help you. Propagating
that change to all of your mongrels might be interesting.

Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com