mirror of
https://github.com/github/rails.git
synced 2026-01-15 01:28:17 -05:00
Fixed infinite loop when environment is missing in database.yml
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@35 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -83,11 +83,15 @@ module ActiveRecord
|
||||
when ConnectionSpecification
|
||||
@@defined_connections[self] = spec
|
||||
when Symbol, String
|
||||
establish_connection(configurations[spec.to_s])
|
||||
if configuration = configurations[spec.to_s]
|
||||
establish_connection(configuration)
|
||||
else
|
||||
raise AdapterNotSpecified
|
||||
end
|
||||
else
|
||||
spec = symbolize_strings_in_hash(spec)
|
||||
unless spec.key?(:adapter) then raise AdapterNotSpecified end
|
||||
|
||||
|
||||
adapter_method = "#{spec[:adapter]}_connection"
|
||||
unless respond_to?(adapter_method) then raise AdapterNotFound end
|
||||
remove_connection
|
||||
|
||||
Reference in New Issue
Block a user