From e7f56a7fe8fbb10e62a18b836c27aa1a0f7c5464 Mon Sep 17 00:00:00 2001 From: Arthur Neves Date: Fri, 3 Jan 2014 16:39:50 -0500 Subject: Raise if MemCacheStore doenst receive a Dalli obj :mem_cache_store should receive a list of hosts or a dalli client, otherwise raise it. Also adding a changelog. --- activesupport/lib/active_support/cache/mem_cache_store.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activesupport/lib/active_support/cache/mem_cache_store.rb') diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb index 1ac4819d47..0eacc4c078 100644 --- a/activesupport/lib/active_support/cache/mem_cache_store.rb +++ b/activesupport/lib/active_support/cache/mem_cache_store.rb @@ -46,6 +46,9 @@ module ActiveSupport options = addresses.extract_options! super(options) + unless [String, Dalli::Client, NilClass].include?(addresses.first.class) + raise ArgumentError, "First argument must be an empty array, an array of hosts or a Dalli::Client instance." + end if addresses.first.is_a?(Dalli::Client) @data = addresses.first else -- cgit v1.2.3