mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +00:00
replace const_defined? with defined?
This commit is contained in:
parent
863cfe4057
commit
b5b4164967
1 changed files with 1 additions and 8 deletions
|
|
@ -5,14 +5,7 @@ module Rack
|
||||||
module StoreProxy
|
module StoreProxy
|
||||||
class RedisStoreProxy < SimpleDelegator
|
class RedisStoreProxy < SimpleDelegator
|
||||||
def self.handle?(store)
|
def self.handle?(store)
|
||||||
# Using const_defined? for now.
|
defined?(::Redis::Store) && store.is_a?(::Redis::Store)
|
||||||
#
|
|
||||||
# Go back to use defined? once this ruby issue is
|
|
||||||
# fixed and released:
|
|
||||||
# https://bugs.ruby-lang.org/issues/14407
|
|
||||||
#
|
|
||||||
# defined?(::Redis::Store) && store.is_a?(::Redis::Store)
|
|
||||||
const_defined?("::Redis::Store") && store.is_a?(::Redis::Store)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(store)
|
def initialize(store)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue