Skip to content
Browse files

ObserverExtensions#update_with_masterdb now works with ActiveRecord s…

…ubclasses, e.g when using STI

Signed-off-by: Chris Wanstrath <chris@ozmm.org>
  • Loading branch information...
1 parent 7d07347 commit 5b026a4ee25726c817a468315b955c3b9acaf23c ethem committed with defunkt Dec 16, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/active_reload/connection_proxy.rb
View
2 lib/active_reload/connection_proxy.rb
@@ -122,7 +122,7 @@ def self.included(base)
# Send observed_method(object) if the method exists.
def update_with_masterdb(observed_method, object) #:nodoc:
- if object.class.connection.respond_to?(:with_master)
+ if object.respond_to?(:connection) && object.connection.respond_to?(:with_master)
object.class.connection.with_master do
update_without_masterdb(observed_method, object)
end

0 comments on commit 5b026a4

Please sign in to comment.
Something went wrong with that request. Please try again.