提交 eec4638e 编写于 作者: D David Heinemeier Hansson

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
上级 bc804601
......@@ -83,7 +83,11 @@ def self.establish_connection(spec = nil)
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册