Comments on: Ruby on Rails – Multiple database connections http://pullmonkey.com/2008/04/21/ruby-on-rails-multiple-database-connections/ Thu, 05 Nov 2009 17:21:42 +0000 hourly 1 https://wordpress.org/?v=5.6 By: Random Knowledge » Blog Archive » Ruby On Rails: Multiple Database Connections http://pullmonkey.com/2008/04/21/ruby-on-rails-multiple-database-connections/comment-page-1/#comment-2186 Thu, 05 Nov 2009 17:21:42 +0000 /2008/04/21/ruby-on-rails-multiple-database-connections#comment-2186 […] to connect to two databases simultaneously. After searching online, I came across this example: http://pullmonkey.com/2008/04/21/ruby-on-rails-multiple-database-connections/ Category: Ruby on Rails You can follow any responses to this entry through the RSS 2.0 feed. […]

]]>
By: sukeerthiadiga http://pullmonkey.com/2008/04/21/ruby-on-rails-multiple-database-connections/comment-page-1/#comment-381 Mon, 21 Apr 2008 14:53:00 +0000 /2008/04/21/ruby-on-rails-multiple-database-connections#comment-381 seems to be very simple !!!
will try and get to u back if any problem..
Thanks any ways
made my work simpler

]]>
By: Nuttapong http://pullmonkey.com/2008/04/21/ruby-on-rails-multiple-database-connections/comment-page-1/#comment-382 Mon, 21 Apr 2008 14:53:00 +0000 /2008/04/21/ruby-on-rails-multiple-database-connections#comment-382 Thank you. That ‘s I’m looking for.

If I want to connect per action can I use with these code >>

class Bidding < ActiveRecord::Base
establish_connection "robot_database", :on => [:create, :save, :destroy]
end

I’ ll test and come back with result.

]]>
By: charlie http://pullmonkey.com/2008/04/21/ruby-on-rails-multiple-database-connections/comment-page-1/#comment-383 Mon, 21 Apr 2008 14:53:00 +0000 /2008/04/21/ruby-on-rails-multiple-database-connections#comment-383 @Nuttapong – nice try 🙂 the actions are not known to the model. I am sure there is a way, although, I can’t see what the use would be … any ideas?

]]>
By: Cakey http://pullmonkey.com/2008/04/21/ruby-on-rails-multiple-database-connections/comment-page-1/#comment-384 Mon, 21 Apr 2008 14:53:00 +0000 /2008/04/21/ruby-on-rails-multiple-database-connections#comment-384 @Nutta
how about
putting establish_connection in callback blocks?

haven’t tried it though

]]>