Multiple databases


#1

Hi,

I’m writing a translation plugin which takes the translations from a
database that is different than the application’s main database.
When in my plugin’s models I put this code:

ActiveRecord::Base.establish_connection(
RAILS_ENV+"-translations"
)

all my application’s models use the plugin’s database…
Why are my application’s models not using the default database? The
plugin models are not related to the application’s models.

Thanks.

Raph


#2

On 12/19/05, Raphael B. removed_email_address@domain.invalid wrote:

all my application’s models use the plugin’s database…
Why are my application’s models not using the default database? The
plugin models are not related to the application’s models.

solution, use this code in the model:

establish_connection(
RAILS_ENV+"-translations"
)

sorry for the noise :expressionless:

Raph