diff --git a/.travis.yml b/.travis.yml index 3fe43feb..d39c2375 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: ruby services: - docker rvm: - - jruby-9.1.17.0 + - jruby-9.2.11.0 - 2.1.9 - 2.2.9 - 2.3.6 diff --git a/lib/apartment/railtie.rb b/lib/apartment/railtie.rb index e082ab9e..255f6273 100644 --- a/lib/apartment/railtie.rb +++ b/lib/apartment/railtie.rb @@ -34,7 +34,6 @@ class Railtie < Rails::Railtie Apartment.connection_class.connection_pool.with_connection do Apartment::Tenant.init end - # rubocop:disable Lint/SuppressedException rescue ::ActiveRecord::NoDatabaseError, PG::ConnectionBad # Since `db:create` and other tasks invoke this block from Rails 5.2.0, # we need to swallow the error to execute `db:create` properly. @@ -42,7 +41,6 @@ class Railtie < Rails::Railtie 'Failed to initialize Apartment because a database connection could not be established.' end end - # rubocop:enable Lint/SuppressedException end # diff --git a/lib/tasks/apartment.rake b/lib/tasks/apartment.rake index 437deda7..d8353821 100644 --- a/lib/tasks/apartment.rake +++ b/lib/tasks/apartment.rake @@ -22,7 +22,7 @@ apartment_namespace = namespace :apartment do begin puts("Dropping #{tenant} tenant") Apartment::Tenant.drop(tenant) - rescue Apartment::TenantNotFound => e + rescue Apartment::TenantNotFound, ActiveRecord::NoDatabaseError => e puts e.message end end