From a060c41ef77cf3a0e4d236a70f3fef260ff9a261 Mon Sep 17 00:00:00 2001 From: Alexey Vakhov Date: Fri, 4 May 2012 12:54:20 +0400 Subject: Use relative path to sqlite3 db in `rails db` command Rails uses sqlit3 db file with a path relative to the rails root. It allows to execute server not from rails root only. For example you can fire `./spec/dummy/script/rails s` to start dummy application server if you develop some engine gem. Now the `rails db` command uses relative paths also and you can explore your dummy db via `./spec/dummy/script/rails db` command. --- railties/lib/rails/commands/dbconsole.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb index aaba47117f..cdff9c6f86 100644 --- a/railties/lib/rails/commands/dbconsole.rb +++ b/railties/lib/rails/commands/dbconsole.rb @@ -96,7 +96,7 @@ module Rails args << "-#{options['mode']}" if options['mode'] args << "-header" if options['header'] - args << config['database'] + args << File.expand_path(config['database'], Rails.root) find_cmd_and_exec('sqlite3', *args) -- cgit v1.2.3