mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
.available_strategies should be part of the adapter contract.
This commit is contained in:
parent
29b444cec4
commit
63f3c47964
2 changed files with 5 additions and 5 deletions
|
@ -168,11 +168,7 @@ module DatabaseCleaner
|
||||||
begin
|
begin
|
||||||
require "database_cleaner/#{orm.to_s}/#{strategy.to_s}"
|
require "database_cleaner/#{orm.to_s}/#{strategy.to_s}"
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
if orm_module.respond_to?(:available_strategies)
|
raise UnknownStrategySpecified, "The '#{strategy}' strategy does not exist for the #{orm} ORM! Available strategies: #{orm_module.available_strategies.join(', ')}"
|
||||||
raise UnknownStrategySpecified, "The '#{strategy}' strategy does not exist for the #{orm} ORM! Available strategies: #{orm_module.available_strategies.join(', ')}"
|
|
||||||
else
|
|
||||||
raise UnknownStrategySpecified, "The '#{strategy}' strategy does not exist for the #{orm} ORM!"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
retry
|
retry
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,10 @@ require 'database_cleaner/redis/truncation'
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
module Ohm
|
module Ohm
|
||||||
|
def self.available_strategies
|
||||||
|
%w(truncation)
|
||||||
|
end
|
||||||
|
|
||||||
class Truncation < ::DatabaseCleaner::Redis::Truncation
|
class Truncation < ::DatabaseCleaner::Redis::Truncation
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in a new issue