I'm getting a lot (hundreds) of warnings when I run my rspec tests with --warning flag enabled.
/Users/esasse/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/apartment-2.1.0/lib/apartment.rb:66: warning: instance variable @connection_class not initialized
/Users/esasse/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/apartment-2.1.0/lib/apartment.rb:66: warning: instance variable @connection_class not initialized
/Users/esasse/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/apartment-2.1.0/lib/apartment/adapters/abstract_adapter.rb:46: warning: instance variable @default_tenant not initialized
/Users/esasse/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/apartment-2.1.0/lib/apartment.rb:66: warning: instance variable @connection_class not initialized
/Users/esasse/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/apartment-2.1.0/lib/apartment.rb:62: warning: instance variable @persistent_schemas not initialized
System configuration
Database: PostgreSQL 10
Apartment version: 2.1
Apartment config (in config/initializers/apartment.rb or so):
require "apartment/elevators/custom_subdomain"
Rails.env.on(:development, :test) do
Apartment.configure do |config|
config.tenant_names = %w[tenant_a]
end
end
Rails.env.on(:production, :staging) do
Apartment.configure do |config|
config.tenant_names = %w[tenant_a tenant_b tenant_c]
end
end
Apartment.configure do |config|
config.prepend_environment = false
config.seed_after_create = false
config.default_schema = "tenant_a"
end
Rails.application.config.middleware.use Apartment::Elevators::CustomSubdomain
I'm getting a lot (hundreds) of warnings when I run my rspec tests with --warning flag enabled.
System configuration
config/initializers/apartment.rb
or so):