Sha256: 63386f8aa21a0eefd9f144dba2c76838067130aa7eba5118c25ed8b419c98ae2
Contents?: true
Size: 649 Bytes
Versions: 9
Compression:
Stored size: 649 Bytes
Contents
require 'database_cleaner/generic/base' module DatabaseCleaner module Redis def self.available_strategies %w{truncation} end module Base include ::DatabaseCleaner::Generic::Base def db=(desired_db) @db = desired_db end def db @db ||= :default end alias url db private def connection @connection ||= begin if url == :default ::Redis.new elsif db.class.is_a?(::Redis) # pass directly the connection db else ::Redis.new(:url => url) end end end end end end
Version data entries
9 entries across 9 versions & 2 rubygems