Fixes warning instead of hiding it

Warning was: 'warning: instance variable @data not initialized'
This commit is contained in:
Gonzalo Rodriguez 2018-01-23 16:54:13 -03:00
parent e8102910bf
commit 218a320a3d
2 changed files with 4 additions and 2 deletions

View file

@ -10,7 +10,6 @@ namespace :test do
Rake::TestTask.new(:integration) do |t|
t.pattern = "spec/integration/*_spec.rb"
t.warning = false
end
end

View file

@ -20,7 +20,10 @@ module Rack
# We also want to use the underlying Dalli client instead of ::ActiveSupport::Cache::MemCacheStore,
# and the MemCache client if using Rails 3.x
client = store.instance_variable_get(:@data)
if store.instance_variable_defined?(:@data)
client = store.instance_variable_get(:@data)
end
if ACTIVE_SUPPORT_WRAPPER_CLASSES.include?(store.class.to_s) && ACTIVE_SUPPORT_CLIENTS.include?(client.class.to_s)
client
else