mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
Fixes warning instead of hiding it
Warning was: 'warning: instance variable @data not initialized'
This commit is contained in:
parent
e8102910bf
commit
218a320a3d
2 changed files with 4 additions and 2 deletions
1
Rakefile
1
Rakefile
|
|
@ -10,7 +10,6 @@ namespace :test do
|
|||
|
||||
Rake::TestTask.new(:integration) do |t|
|
||||
t.pattern = "spec/integration/*_spec.rb"
|
||||
t.warning = false
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue