prevents loading 'default' DB in AR to guard against odd error messages #72
This commit is contained in:
parent
f8df3db3af
commit
ab066b1985
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue