Permalink
Browse files

updating master filter to work with new masochism updates

Signed-off-by: rick <technoweenie@gmail.com>
  • Loading branch information...
1 parent c7a0141 commit 76165106bc0d1e9bd2caac6f033e14e6adbc099b @abloom abloom committed with technoweenie Jan 7, 2009
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/active_reload/master_filter.rb
@@ -2,10 +2,8 @@ module ActiveReload
# MasterFilter should be used as an around filter in your controllers that require certain actions to use the Master DB for reads as well as writes
class MasterFilter
def self.filter(controller, &block)
- proxy = ActiveRecord::Base.active_connections['ActiveRecord::Base']
-
- if proxy.respond_to?(:with_master)
- proxy.with_master(&block)
+ if ActiveRecord::Base.connection.respond_to?(:with_master)
+ ActiveRecord::Base.connection.with_master(&block)
else
yield block
end

0 comments on commit 7616510

Please sign in to comment.