Skip to content

Commit

Permalink
Extract options before creating connection
Browse files Browse the repository at this point in the history
Calls extract_options! on the addresses arguments before passing the addresses to the ::Redis::Factory.  This fixes redis-store#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
mjtko committed Feb 20, 2013
1 parent dd8d211 commit e6437d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion redis-activesupport/lib/active_support/cache/redis_store.rb
Expand Up @@ -24,8 +24,9 @@ class RedisStore < Store
# RedisStore.new "localhost:6379/0", "localhost:6380/0" # RedisStore.new "localhost:6379/0", "localhost:6380/0"
# # => instantiate a cluster # # => instantiate a cluster
def initialize(*addresses) def initialize(*addresses)
options = addresses.extract_options!
@data = ::Redis::Factory.create(addresses) @data = ::Redis::Factory.create(addresses)
super(addresses.extract_options!) super(options)
end end


def write(name, value, options = nil) def write(name, value, options = nil)
Expand Down

0 comments on commit e6437d8

Please sign in to comment.