mysql - Rails refer to 2nd DB for single table -
i have 2 mysql databases on single host. want use first database , refer second database single, specific table. db calls should refer first db except calls reference specific table. there way either forward db requests db or adjust configurations in rails accommodate this?
you can use establish_connection in class
class user < activerecord::base establish_connection( adapter: 'mysql2' encoding: 'utf8' pool: 5 username: 'me' password: 'mypassword' ) end
you can find more details here
Comments
Post a Comment