Displaying 1 result from an estimated 1 matches for "shared_database".
2008 May 05
0
uses_connection plugin
...del basis. It is useful when you
have multiple applications sharing the same data, in other words, this
is just a nicer way of using “Model.establish_connection(database)”.
Example:
=======
First create a ‘shared’ database configuration in config/database.yml:
shared:
adapter: mysql
database: shared_database
username: user
password: password
host: dbs_host
Next tell your model that it should connect the the ‘shared’ database
and use the table there…
class ZipCode < ActiveRecord::Base
# Uses the ''shared'' database in all environments
uses_connection :shared, :in => :al...