Sha256: 59684d6b0a33b2f542c4551ac417696918b230417eb47fd4e473cd3449867f78

Contents?: true

Size: 493 Bytes

Versions: 15

Compression:

Stored size: 493 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 ||= url == :default ? ::Redis.connect : ::Redis.connect(:url => url)
      end

    end
  end
end

Version data entries

15 entries across 10 versions & 3 rubygems

Version Path
database_cleaner-1.5.1 lib/database_cleaner/redis/base.rb
database_cleaner-1.5.0 lib/database_cleaner/redis/base.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/database_cleaner-1.4.1/lib/database_cleaner/redis/base.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/database_cleaner-1.4.1/lib/database_cleaner/redis/base.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/database_cleaner-1.4.1/lib/database_cleaner/redis/base.rb
database_cleaner-1.4.1 lib/database_cleaner/redis/base.rb
database_cleaner-1.4.0 lib/database_cleaner/redis/base.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/database_cleaner-1.2.0/lib/database_cleaner/redis/base.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/database_cleaner-1.2.0/lib/database_cleaner/redis/base.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/database_cleaner-1.2.0/lib/database_cleaner/redis/base.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/database_cleaner-1.2.0/lib/database_cleaner/redis/base.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/database_cleaner-1.2.0/lib/database_cleaner/redis/base.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/database_cleaner-1.2.0/lib/database_cleaner/redis/base.rb
database_cleaner-1.3.0 lib/database_cleaner/redis/base.rb
database_cleaner-1.2.0 lib/database_cleaner/redis/base.rb