TalentBox / sequel-rails

A gem for using Sequel with Rails 5.x, 6.x, 7.x, 8.x
http://talentbox.github.io/sequel-rails/
MIT License
326 stars 81 forks source link

Update to Sequel 5.0.0 #143

Closed Jesterovskiy closed 7 years ago

ckoenig commented 7 years ago

Since Sequel 5 immediately attempts to connect to the configured database, the development DB sequel_rails_test_storage_dev needs to be created, too.

Adding the following two lines to .travis.yml will hopefully fix most of the failed tests:

- mysql -e 'create database sequel_rails_test_storage_dev;'
- psql -c 'create database sequel_rails_test_storage_dev;' -U postgres
ckoenig commented 7 years ago

The sqlite3 tests are failing because SequelRails::DbConfig#build_url converts a relative path into an absolute path. Combined with the fact, that Sequel 5 is now eagerly trying to connect to a DB, the test fails.

To fix the test, it might be enough to replace the relative with an absolute path in the Rakefile:

diff --git a/Rakefile b/Rakefile
index 5d991e4..995ab3a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -30,7 +30,7 @@ begin

     configs = {
       'postgresql' => { 'TEST_ENCODING' => 'unicode' },
-      'sqlite3'    => { 'TEST_DATABASE' => 'db/database.sqlite3' },
+      'sqlite3'    => { 'TEST_DATABASE' => File.join(File.expand_path("."), "spec/internal/db/database.sqlite3") },
     }
Jesterovskiy commented 7 years ago

@ckoenig Thank you for your help! yesterday I seems to have folded the wrong way =)

Jesterovskiy commented 7 years ago

@JonathanTron @JosephHalter I think PR ready for review =)

JonathanTron commented 7 years ago

@Jesterovskiy Thanks a lot for the amazing work!

I'll take some time to review and merge in the next couple of days.

JonathanTron commented 7 years ago

Thanks @Jesterovskiy for the good work, I'll merge the request and change the dependencies to deps to work with Sequel < 6.0 as @bgentry suggested.

Jesterovskiy commented 7 years ago

@JonathanTron Thank you! Now you can release this, right?