Merge pull request #619 from DatabaseCleaner/fix_and_deprecate_ohm_adapter

Fix and deprecate Ohm adapter
This commit is contained in:
Ernesto Tagwerker 2020-02-01 15:25:35 -05:00 committed by GitHub
commit a8d1482037
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -2,6 +2,8 @@ require "database_cleaner/ohm/version"
require "database_cleaner"
require "database_cleaner/ohm/truncation"
DatabaseCleaner.deprecate "The Ohm adapter for DatabaseCleaner is deprecated, and will be removed in v2.0. Please use the Redis adapter instead."
module DatabaseCleaner::Ohm
def self.default_strategy
:truncation

View file

@ -1,4 +1,9 @@
begin # when database_cleaner-ohm is loaded as a gem
require 'database_cleaner/redis/truncation'
rescue LoadError # when database_cleaner is loaded as a gem
$LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/../../../../../adapters/database_cleaner-redis/lib")
require 'database_cleaner/redis/truncation'
end
module DatabaseCleaner
module Ohm