lib/multiverse/railtie.rb in multiverse-0.2.1 vs lib/multiverse/railtie.rb in multiverse-0.2.2
- old
+ new
@@ -34,10 +34,11 @@
Rails.application.config.database_configuration.each do |env, config|
if env.start_with?("#{Multiverse.db}_")
new_config[env.sub("#{Multiverse.db}_", "")] = config
end
end
- ActiveRecord::Tasks::DatabaseTasks.database_configuration.merge!(new_config)
+ abort "Unknown DB: #{Multiverse.db}" if new_config.empty?
+ ActiveRecord::Tasks::DatabaseTasks.database_configuration = new_config
end
# load config
ActiveRecord::Base.configurations = ActiveRecord::Tasks::DatabaseTasks.database_configuration || {}
ActiveRecord::Migrator.migrations_paths = ActiveRecord::Tasks::DatabaseTasks.migrations_paths