Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 5b026a4ee25726c817a468315b955c3b9acaf23c 1 parent 7d07347
ethem authored defunkt committed
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
Please sign in to comment.
Something went wrong with that request. Please try again.