Displaying 2 results from an estimated 2 matches for "change_database".
2006 Feb 27
5
Database connections...so many connections!
...(http://wiki.rubyonrails.com/rails/pages/HowtoUseMultipleDatabases), I
moved the code from the application controller into each controller (as
I thought it was prettier / easier / simpler ) . In each controller is
the following code:
class XYZController < ApplicationController
before_filter :change_database
def change_database
ActiveRecord::Base.establish_connection(
:adapter => "oci",
:database => "",
:host => "******",
:username => "******", # Differs between controller
:password => "********" # Differs...
2006 Jan 24
4
Parse request URL.
Hello all.
Due to the mistakes of the company before I joined ;) I am stuck with a
multiple database setup. I am planning on parsing the REQUEST_URL to
decide which controller is being accessed and basing the
establish_connection on that. Before I go messing around with regexps I
was wondering if rails has a built in function for parsing URLS. I have
googled around a bit and seen net/http