Add activerecord/db/ to gitignore

After running `bundle exec rake test:sqlite3` and `bundle exec rake test:sqlite3_mem`
on my VM I noticed that it had created untracked files:

```bash
vagrant@ubuntu-bionic:/rails/activerecord$ git status
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        db/
        file::memory:
```

To prevent them from being accidentally committed I put 'file::memory:' to
`activerecord/db/` folder and added the folder to .gitignore
Also, we could consider fixing this by removing `db/` folder in each test that
creates the folder.

It would be great if someone confirms that it happens not only on my VM.
This commit is contained in:
bogdanvlviv 2020-03-02 13:48:59 +00:00
parent 6d0895a489
commit 22877a9ddd
No known key found for this signature in database
GPG Key ID: E4ACD76A6DB6DFDD
2 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,4 @@
/db/
/sqlnet.log
/test/config.yml
/test/fixtures/*.sqlite*

View File

@ -108,7 +108,7 @@ class SQLite3TransactionTest < ActiveRecord::SQLite3TestCase
def with_connection(options = {})
db_config = ActiveRecord::Base.configurations.configs_for(env_name: "arunit", name: "primary")
conn_options = options.reverse_merge(
database: in_memory_db? ? "file::memory:" : db_config.database
database: in_memory_db? ? "db/file::memory:" : db_config.database
)
conn = ActiveRecord::Base.sqlite3_connection(conn_options)