tchandy/octopus — pull request #242 by djudd (2014-05-03 01:09:54+00:00)
Title: Allow use of Octopus with models with custom connection

So you can say:

```
class CustomConnectedModel
octopus_establish_connection(...)
end
```

And then:

```
CustomConnectedModel.first # uses custom connection
CustomConnectedModel.using(:read_standby).first # uses read standby
```

For backwards compatibility & configurability, this only takes effect once a class attribute 'allow_octopus' is explicitly set on the model which has called octopus_establish_connection.

The use case is a model I have that lives in a separate database, which I do not normally want to have to think about when using it, but I would like to be able to call "using(:separate_db_standby)" with an Octopus-managed shard to access a read slave for the model.

The change to explicitly require ActiveRecord < 4.1 was necessary to get things working on my machine, since it seems 4.1 isn't supported yet, but I can pull it out if you prefer.

Please ignore the branch name, which references an abandoned earlier approach.