diff --git a/lib/database_rewinder.rb b/lib/database_rewinder.rb index 8c73cf2..b674a7f 100644 --- a/lib/database_rewinder.rb +++ b/lib/database_rewinder.rb @@ -22,6 +22,8 @@ def create_cleaner(connection_name) end def [](connection) + init unless defined? @cleaners + @cleaners.detect {|c| c.connection_name == connection} || create_cleaner(connection) end