Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning: instance variable not initialized #538

Closed
esasse opened this issue Mar 20, 2018 · 1 comment
Closed

warning: instance variable not initialized #538

esasse opened this issue Mar 20, 2018 · 1 comment

Comments

@esasse
Copy link

esasse commented Mar 20, 2018

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
  • Rails (or ActiveRecord) version: 5.1.5
  • Ruby version: 2.4.1
@esasse
Copy link
Author

esasse commented May 31, 2019

I can't reproduce with current version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant