1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/test
Carlos Antonio da Silva 53aefdec91 Fix rails db command with sqlite3 database
When using sqlite3 it was attempting to find the database file based on
Rails.root, the problem is that Rails.root is not always present because
we try to first manually load "config/database.yml" instead of loading
the entire app, to make "rails db" faster.

This means that when we're in the root path of the app, calling "rails db"
won't allow us to use Rails.root, making the command fail for sqlite3
with the error:

    ./rails/commands/dbconsole.rb:62:in `start':
      undefined method `root' for Rails:Module (NoMethodError)

The fix is to simply not pass any dir string to File.expand_path, which
will make it use the current directory of the process as base, or the
root path of the app, which is what we want.

When we are in any other subdirectory, calling "rails db" should work
just fine, because "config/database.yml" won't be found, thus "rails db"
will fallback to loading the app, making Rails.root available.

Closes #8257.
2012-11-18 23:52:39 -02:00
..
application Add UpgradeSignatureToEncryptionCookieStore 2012-11-16 17:29:26 -02:00
commands Fix rails db command with sqlite3 database 2012-11-18 23:52:39 -02:00
configuration using __method__ for the command method calls 2012-05-21 16:20:40 -07:00
fixtures Use Ruby 1.9 Hash syntax in railties 2012-10-14 18:26:58 +02:00
generators Merge pull request #8112 from rails/encrypted_cookies 2012-11-15 12:17:25 -08:00
isolation Rename secret_token_key to secret_key_base 2012-11-03 14:57:54 -02:00
railties Fix typo in #7941 2012-10-14 10:20:07 -07:00
abstract_unit.rb Rename secret_token_key to secret_key_base 2012-11-03 14:57:54 -02:00
backtrace_cleaner_test.rb Gem cont presence checking has been removed 2012-05-02 13:56:13 +03:00
engine_test.rb Remove another missing test related to draw external routes 2012-06-29 14:55:09 -03:00
generators_test.rb Use Ruby 1.9 Hash syntax in railties 2012-10-14 18:26:58 +02:00
initializable_test.rb Use Ruby 1.9 Hash syntax in railties 2012-10-14 18:26:58 +02:00
paths_test.rb Use Ruby 1.9 Hash syntax in railties 2012-10-14 18:26:58 +02:00
rails_info_controller_test.rb Use Ruby 1.9 Hash syntax in railties 2012-10-14 18:26:58 +02:00
rails_info_test.rb Updated/changed useless tr/gsubs 2012-04-03 15:16:09 +02:00
script_rails_loader_test.rb Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00