Browse files

Extract options before creating connection

Calls extract_options! on the addresses arguments before passing the addresses to the ::Redis::Factory.  This fixes #166 so default cache options can now be passed without causing a DistributedStore to be created with both the intended server as well as a spurious localhost connection. 
  • Loading branch information...
1 parent dd8d211 commit e6437d8a7559362bc23348fd14a7a0fbb0fe0d1f @mjtko committed Feb 20, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 redis-activesupport/lib/active_support/cache/redis_store.rb
View
3 redis-activesupport/lib/active_support/cache/redis_store.rb
@@ -24,8 +24,9 @@ class RedisStore < Store
# RedisStore.new "localhost:6379/0", "localhost:6380/0"
# # => instantiate a cluster
def initialize(*addresses)
+ options = addresses.extract_options!
@data = ::Redis::Factory.create(addresses)
- super(addresses.extract_options!)
+ super(options)
end
def write(name, value, options = nil)

0 comments on commit e6437d8

Please sign in to comment.