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:
Comments
Post a Comment