Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

Commit

Permalink
Avoid recursive respond_to? calls in stub collection proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
kovyrin committed Nov 10, 2013
1 parent b12e468 commit a99cd7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/db_charmer/sharding/stub_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def real_connection
end

def respond_to?(method_name, include_all = false)
super || real_connection.respond_to?(method_name, include_all)
return true if super
return false if real_connection.object_id == self.object_id
real_connection.respond_to?(method_name, include_all)
end

def method_missing(meth, *args, &block)
Expand Down

0 comments on commit a99cd7d

Please sign in to comment.