Skip to content

Commit 70da8ea

Browse files
authored
Merge pull request #89 from fangherk/master
Add dbconsole changes
2 parents 7a425b6 + 733939c commit 70da8ea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/railties/rails/commands/dbconsole.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def start
2727

2828
args << db_config.database
2929

30-
find_cmd_and_exec(["mysql", "mysql5"], *args)
30+
ActiveRecord::Base.connection.class.find_cmd_and_exec(["mysql", "mysql5"], *args)
3131

3232
when /^postgres|^postgis/
3333
ENV["PGUSER"] = config[:username] if config[:username]
@@ -38,7 +38,7 @@ def start
3838
ENV["PGSSLCERT"] = config[:sslcert].to_s if config[:sslcert]
3939
ENV["PGSSLKEY"] = config[:sslkey].to_s if config[:sslkey]
4040
ENV["PGSSLROOTCERT"] = config[:sslrootcert].to_s if config[:sslrootcert]
41-
find_cmd_and_exec("psql", db_config.database)
41+
ActiveRecord::Base.connection.class.find_cmd_and_exec("psql", db_config.database)
4242

4343
when "sqlite3", "litedb"
4444
args = []
@@ -47,7 +47,7 @@ def start
4747
args << "-header" if @options[:header]
4848
args << File.expand_path(db_config.database, Rails.respond_to?(:root) ? Rails.root : nil)
4949

50-
find_cmd_and_exec("sqlite3", *args)
50+
ActiveRecord::Base.connection.class.find_cmd_and_exec("sqlite3", *args)
5151

5252
when "oracle", "oracle_enhanced"
5353
logon = ""
@@ -58,7 +58,7 @@ def start
5858
logon << "@#{db_config.database}" if db_config.database
5959
end
6060

61-
find_cmd_and_exec("sqlplus", logon)
61+
ActiveRecord::Base.connection.class.find_cmd_and_exec("sqlplus", logon)
6262

6363
when "sqlserver"
6464
args = []
@@ -73,7 +73,7 @@ def start
7373
args += ["-S", host_arg]
7474
end
7575

76-
find_cmd_and_exec("sqlcmd", *args)
76+
ActiveRecord::Base.connection.class.find_cmd_and_exec("sqlcmd", *args)
7777

7878
else
7979
abort "Unknown command-line client for #{db_config.database}."

0 commit comments

Comments
 (0)