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

Database drop fix for Sequel (>= 5.38.0) #184

Closed AnotherRegularDude closed 3 years ago

AnotherRegularDude commented 3 years ago

When we try to recreate a database using the rails db:drop db:create command with a non-existent database, we will crash when the Sequel::Model#db method is called. This happens because array Sequel::DATABASES is empty (this change in Sequel).

I think we just need to check a size of Sequel::DATABASES before processing #drop.

JonathanTron commented 3 years ago

Hi @AnotherRegularDude, thanks for working on the fix!