Replacing / retrieving table from another database connection inside a model within Rails -


let's i'm within rails project in model named apple.

i'm going switch databases server i'll call: activerecord::base.establish_connection()

i want access table 'banana' in particular database. can see table exists calling table_exists?

however, i'm not sure how access table... want able banana.find(:all)

how should work out?

have tried connection_ninja gem? pretty handy multi-db connections:

https://github.com/cherring/connection_ninja


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -