From 22877a9dddde2e2a352ca3c551fa80147e768335 Mon Sep 17 00:00:00 2001 From: bogdanvlviv Date: Mon, 2 Mar 2020 13:48:59 +0000 Subject: [PATCH] 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 ..." 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. --- activerecord/.gitignore | 1 + activerecord/test/cases/adapters/sqlite3/transaction_test.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/activerecord/.gitignore b/activerecord/.gitignore index 884ee009eb..effb81c892 100644 --- a/activerecord/.gitignore +++ b/activerecord/.gitignore @@ -1,3 +1,4 @@ +/db/ /sqlnet.log /test/config.yml /test/fixtures/*.sqlite* diff --git a/activerecord/test/cases/adapters/sqlite3/transaction_test.rb b/activerecord/test/cases/adapters/sqlite3/transaction_test.rb index 570959acf4..7888bbbf49 100644 --- a/activerecord/test/cases/adapters/sqlite3/transaction_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/transaction_test.rb @@ -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)