Open kuzukuzu opened 3 years ago
In my project, this resolves the problem.
class SomeApplication < Rails::Application
rake_tasks do
Rake::Task['db:create'].enhance do
Apartment.connection_class.connection_pool.with_connection do
Apartment::Tenant.init
end
end
end
end
Steps to reproduce
Configure excluded models.
db/seeds.rb
is as below.And call
db:setup
. (assume that 'public' tenant does not exist)Outputs this.
Expected behavior
excluded_models
have effect also indb:setup
.Actual behavior
excluded_models
have no effect indb:setup
.System configuration
Database: mysql 5.6
Apartment version: 2.2.1
Apartment config (in
config/initializers/apartment.rb
or so):use_schemas
: default (true)prepend_environment
: trueRails (or ActiveRecord) version: 5.2.4.5
Ruby version: 2.5.8