prevents loading 'default' DB in AR to guard against odd error messages #72

This commit is contained in:
Ben Mabey 2011-11-03 16:57:34 -06:00
parent f8df3db3af
commit ab066b1985
1 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ module DatabaseCleaner
def self.available_strategies
%w[truncation transaction deletion]
end
def self.config_file_location=(path)
@config_file_location = path
end
@ -32,9 +32,9 @@ module DatabaseCleaner
end
def load_config
if File.file?(ActiveRecord.config_file_location)
if self.db != :default && File.file?(ActiveRecord.config_file_location)
connection_details = YAML::load(ERB.new(IO.read(ActiveRecord.config_file_location)).result)
self.connection_hash = connection_details[self.db.to_s]
@connection_hash = connection_details[self.db.to_s]
end
end