Issue #4868 - Adding warning message to db_connect when already connected

bug/bundler_fix
nstarke 2015-03-10 00:02:34 +00:00
parent 603179176a
commit 187a0445f3
1 changed files with 9 additions and 0 deletions

View File

@ -1706,6 +1706,15 @@ class Db
def cmd_db_connect(*args)
return if not db_check_driver
if framework.db.connection_established?
cdb = ""
::ActiveRecord::Base.connection_pool.with_connection { |conn|
if conn.respond_to? :current_database
cdb = conn.current_database
end
}
return print_status("#{framework.db.driver} already connected to #{cdb}")
end
if (args[0] == "-y")
if (args[1] and not ::File.exists? ::File.expand_path(args[1]))
print_error("File not found")