So, let's say you create a Model User in the main application and transfer it. Then you need to access this Datbase from other applications. It's not a problem. First you need to add the definition of the base connection of the main application to the config/database.yml child application as follows:
parent_connection: adapter: your_adapter_here host: your_host_here username: username password: password database: main_application_production
Then you create a model called "User", but not with scaffolder or sth. like this. Just create a file like this:
class User < ActiveRecord::Base establish_connection :parent_connection
In the default case, the selected connection is the same as the environment name. You only need to specify options. So, now you can access the User class, as in the main application.
source share