rails/rails — pull request #6150 by avakhov (2012-05-04 09:06:45+00:00)
Title: Rails db console improvements

The code in [active_record/connection_adapters/sqlite3_adapter.rb](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb) is slightly dublicated by [rails/commands/dbconsole.rb#L76-83](https://github.com/rails/rails/blob/master/railties/lib/rails/commands/dbconsole.rb#L76-83).

I don't think it's very bad, but I suggest to improve db console a little more. In #6012 I covered db console with tests and we can now improve it a little.

The first commit - abort if we execute `rails db` on memory dtabase. The second - to use rails root expand path as here: [connection_adapters/sqlite3_adapter.rb#L21](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L21).

The first improvment I found only investigating code, but the second is from real life. I developed gem and executed dummy server `./spec/dummy/scripts/rails server`. It worked well. But `./spec/dummy/scripts/rails db` failed with not resolved path to db file.