Permalink
Browse files

Apply fixes suggested by http://github.com/deepak-srishti

  • Loading branch information...
1 parent bf09ca6 commit 67fd679dd5cfc3ba2c49a2fff01505f1783275ad @mauricio committed Nov 9, 2009
Showing with 9 additions and 5 deletions.
  1. +1 −1 README
  2. +8 −4 lib/master_slave_adapter/adapter.rb
View
2 README
@@ -21,7 +21,7 @@ end
To use this adapter you just have to install the plugin:
-ruby script/plugin install git://github.com/mauricio/master_database_adapter.git
+ruby script/plugin install git://github.com/mauricio/master_slave_adapter.git
And then configure it at your database.yml file:
@@ -85,11 +85,15 @@ def test_connections
class << self
def with_master
- enable_master
- begin
+ if master_enabled?
yield
- ensure
- disable_master
+ else
+ enable_master
+ begin
+ yield
+ ensure
+ disable_master
+ end
end
end

0 comments on commit 67fd679

Please sign in to comment.