Module: ActiveRecord::TestDatabases
- Defined in:
- lib/active_record/test_databases.rb
Overview
:nodoc:
Class Method Summary collapse
Class Method Details
.create_and_load_schema(i, env_name:) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/active_record/test_databases.rb', line 19 def self.create_and_load_schema(i, env_name:) old, ENV["VERBOSE"] = ENV["VERBOSE"], "false" ActiveRecord::Base.configurations.configs_for(env_name: env_name, include_hidden: true).each do |db_config| db_config._database = "#{db_config.database}_#{i}" if db_config.database_tasks? ActiveRecord::Tasks::DatabaseTasks.reconstruct_from_schema(db_config, nil) end end ensure ActiveRecord::Base.establish_connection ENV["VERBOSE"] = old end |