Closed hypomodern closed 12 years ago
You can pass in an existing connection to Redis using :redis_connection
in the Redis options hash. Do you need to swap out the Redis connection afterwards?
Yes. I am generating leaderboard objects via a factory method; I suppose I could make the default options that the factory uses injectable, which would work too. If you're opposed to exposing it here for some reason :).
It just seems weird to swap the connection after the fact since then you're in the situation where you've got 2 connections to Redis when I think you only really want one.
For now I'd rather see you go the route of injecting the default options.
also my editor hates trailing whitespace. The only substantive change is declaring
attr_accessor :redis_connection
so you can swap out the redis connection at will.