Skip to content
Master/Slave delegation for ActiveRecord models for reads/writes
Ruby
Find file
Latest commit d7fff18 Mar 2, 2008 Robby Russell Adding documentaiton to the README file
Failed to load latest commit information.
lib
LICENSE Changing the year in the LICENSE Mar 2, 2008
README
init.rb

README

ActiveDelegate
==============

Provides ActiveRecord with the ability to talk to multiple databases from a single model.

# app/models/master_database.rb
class MasterDatabase < ActiveRecord::Base
  handles_connection_for :master_database # <-- this matches the key from our database.yml
end

# app/models/animal.rb
class Animal < ActiveRecord::Base
  delegates_connection_to :master_database, :on => [:create, :save, :destroy]
end

TODO: Add more documentation
Something went wrong with that request. Please try again.