tchandy/octopus — pull request #134 by markrebec (2012-11-29 20:36:55+00:00)
Title: Checking @block causes queries never to get sent to slaves.

When using octopus for replication in ruby 1.9.3/rails 3.2.9, it seemed like read queries were never actually getting sent to slaves. Instead, all queries were using the default/master database connection.

I think I tracked it down to `Octopus::Proxy#should_send_queries_to_replicated_databases?` and the check that `@block` is false.

I can't say I understand exactly why the check for `!@block` is there in the first place, so I might be breaking something here... but it seems when ensuring that `@block` is false, queries never end up getting sent to slaves. I believe it's because this seems to *always* get called from a block in `/lib/octopus/scope_proxy.rb`, lines 28-30.