magic multi-connections allows you to write your model once, and use them for the multiple rails databases at the same time.
sudo gem install magic_multi_connection
After installing this gem, just add this line at bottom of your environment.rb require “magic_multi_connection”