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
|
||||
require "database_cleaner/#{orm.to_s}/#{strategy.to_s}"
|
||||
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(', ')}"
|
||||
else
|
||||
raise UnknownStrategySpecified, "The '#{strategy}' strategy does not exist for the #{orm} ORM!"
|
||||
end
|
||||
raise UnknownStrategySpecified, "The '#{strategy}' strategy does not exist for the #{orm} ORM! Available strategies: #{orm_module.available_strategies.join(', ')}"
|
||||
end
|
||||
retry
|
||||
end
|
||||
|
|
|
@ -2,6 +2,10 @@ require 'database_cleaner/redis/truncation'
|
|||
|
||||
module DatabaseCleaner
|
||||
module Ohm
|
||||
def self.available_strategies
|
||||
%w(truncation)
|
||||
end
|
||||
|
||||
class Truncation < ::DatabaseCleaner::Redis::Truncation
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue