diff --git a/lib/database_cleaner/base.rb b/lib/database_cleaner/base.rb index 8ce49f0..9691cf6 100644 --- a/lib/database_cleaner/base.rb +++ b/lib/database_cleaner/base.rb @@ -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 diff --git a/lib/database_cleaner/ohm/truncation.rb b/lib/database_cleaner/ohm/truncation.rb index 1747a32..a0d0adf 100644 --- a/lib/database_cleaner/ohm/truncation.rb +++ b/lib/database_cleaner/ohm/truncation.rb @@ -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