diff --git a/lib/hitobito_tenants/apartment.rb b/lib/hitobito_tenants/apartment.rb index c36c443..448d37d 100644 --- a/lib/hitobito_tenants/apartment.rb +++ b/lib/hitobito_tenants/apartment.rb @@ -93,7 +93,7 @@ # Rails will use to connect to your database. # # At the time of this writing, the pool-size is 20 - config.parallel_migration_threads = 15 + config.parallel_migration_threads = 0 end module Apartment diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bde5b7d..badbcf1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,22 +13,24 @@ require File.expand_path("../../hitobito/config/environment", __dir__) require "rspec/rails" -require File.join(ENV['APP_ROOT'], 'spec', 'spec_helper.rb') - ActiveRecord::Migration.suppress_messages do - begin - previous_seed_quietness = SeedFu.quiet - SeedFu.quiet = true - - Wagons.all.each do |wagon| - wagon.migrate - wagon.load_seed + if ActiveRecord::Base.maintain_test_schema + ActiveRecord::Migration.load_schema_if_pending! + begin + previous_seed_quietness = SeedFu.quiet + SeedFu.quiet = true + Wagons.all.each do |wagon| + wagon.migrate + wagon.load_seed + end + ensure + SeedFu.quiet = previous_seed_quietness end - ensure - SeedFu.quiet = previous_seed_quietness end end +require File.join(ENV['APP_ROOT'], 'spec', 'spec_helper.rb') + # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. Dir[HitobitoTenants::Wagon.root.join('spec/support/**/*.rb')].sort.each { |f| require f }