<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>LICENSE</filename>
    </added>
    <added>
      <filename>README</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -5,14 +5,23 @@ module ActiveReload
   end
 
   class ConnectionProxy
-    def initialize
-      @slave   = ActiveRecord::Base.connection
-      @master  = ActiveReload::MasterDatabase.connection
+    def initialize(master, slave)
+      @slave   = slave.connection
+      @master  = master.connection
       @current = @slave
     end
     
     attr_accessor :slave, :master
 
+    def self.setup!
+      setup_for ActiveReload::MasterDatabase
+    end
+    
+    def self.setup_for(master, slave = nil)
+      slave ||= ActiveRecord::Base
+      ActiveRecord::Base.active_connections[slave.name] = new(master, slave)
+    end
+
     def with_master
       set_to_master!
       yield</diff>
      <filename>lib/active_reload/connection_proxy.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>init.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>394227098149fae52d95a6be02acf07d64196453</id>
    </parent>
  </parents>
  <author>
    <name>rick</name>
    <email>rick@d98f8484-0aa7-43af-80ea-302c351499d6</email>
  </author>
  <url>http://github.com/technoweenie/masochism/commit/720142f99ad2049d15ea4bd2583f8b8f6914c233</url>
  <id>720142f99ad2049d15ea4bd2583f8b8f6914c233</id>
  <committed-date>2007-10-05T22:59:57-07:00</committed-date>
  <authored-date>2007-10-05T22:59:57-07:00</authored-date>
  <message>allow some more flexibility on when exactly the proxy is setup

git-svn-id: http://ar-code.svn.engineyard.com/plugins/masochism@31 d98f8484-0aa7-43af-80ea-302c351499d6</message>
  <tree>af95e948370b4bd8889b3ba49b38918ec0c155e2</tree>
  <committer>
    <name>rick</name>
    <email>rick@d98f8484-0aa7-43af-80ea-302c351499d6</email>
  </committer>
</commit>
