Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
Rails 3 using non-standard db names
2 Posts
Rails 3 using non-standard db names

Yes both of these are possible and easily solved. For the multi-connection issue, read this post from PullMonkey "here":http://pullmonkey.com/2008/4/21/ruby-on-rails-multiple-database-connections/

For the model with the non-standard name assignment, add this to your model code:

bq. class AModel < ActiveRecord::Base set_table_name "probonderdelen" end

Hi,

I'm having some problems using an existing database. We are using a mysql database for our logging, but the name is not a standard rails name, it is called "probonderdelen". Now I'd like to query this table, but rails won't let me. Is it possible to get arround this?

I also have a second question, is it possible to use a sqllite db and a mysql db at the same time?

Thanks

2 Posts
Login to add your message