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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -