-
Notifications
You must be signed in to change notification settings - Fork 0
jeberly/multi_dbs
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
= Multi-Database plugin for rails by John Eberly Use this plugin to have access to multiple databases in rails. I have not used this in a production environment yet. If you use this plugin, please drop me a note letting me know of your impressions, problems, etc. = Installation script/plugin install git:https://github.com/jeberly/multi_dbs.git = Example Use Here is a real life usage of the plugin for specifying a separate database for each model. = Set database name for any model that does not use default specified in database.yml file class Blog < ActiveRecord::Base has_many :posts end class Post < ActiveRecord::Base set_database_name "db2" belongs_to :blog end The table blog must exist in your default database and table posts should exist in database "db2" Now you can do this -> # Blog.first.posts Currently it does not work with migrations, it assumed table 2..n are managed outside of rails. If you have a patch for this, let me know. :)
About
Specify multiple databases in a rails project.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published