Skip to content

Commit 35e79f0

Browse files
committed
Clean up load_schema options
The filename and format are derived in the load_schema method when called from the rake tasks without arguments. Since these are the same as the defaults we don't need to pass them into the `load_schema` method.
1 parent bcb2a11 commit 35e79f0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

activerecord/lib/active_record/railties/databases.rake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ db_namespace = namespace :db do
495495
task name => :load_config do
496496
original_db_config = ActiveRecord::Base.connection_db_config
497497
db_config = ActiveRecord::Base.configurations.configs_for(env_name: ActiveRecord::Tasks::DatabaseTasks.env, name: name)
498-
ActiveRecord::Tasks::DatabaseTasks.load_schema(db_config, ActiveRecord.schema_format, ENV["SCHEMA"])
498+
ActiveRecord::Tasks::DatabaseTasks.load_schema(db_config)
499499
ensure
500500
ActiveRecord::Base.establish_connection(original_db_config) if original_db_config
501501
end
@@ -615,8 +615,7 @@ db_namespace = namespace :db do
615615
should_reconnect = ActiveRecord::Base.connection_pool.active_connection?
616616
ActiveRecord::Schema.verbose = false
617617
ActiveRecord::Base.configurations.configs_for(env_name: "test").each do |db_config|
618-
filename = ActiveRecord::Tasks::DatabaseTasks.dump_filename(db_config.name)
619-
ActiveRecord::Tasks::DatabaseTasks.load_schema(db_config, ActiveRecord.schema_format, filename)
618+
ActiveRecord::Tasks::DatabaseTasks.load_schema(db_config)
620619
end
621620
ensure
622621
if should_reconnect
@@ -660,9 +659,8 @@ db_namespace = namespace :db do
660659
task name => "db:test:purge:#{name}" do
661660
should_reconnect = ActiveRecord::Base.connection_pool.active_connection?
662661
ActiveRecord::Schema.verbose = false
663-
filename = ActiveRecord::Tasks::DatabaseTasks.dump_filename(name)
664662
db_config = ActiveRecord::Base.configurations.configs_for(env_name: "test", name: name)
665-
ActiveRecord::Tasks::DatabaseTasks.load_schema(db_config, ActiveRecord.schema_format, filename)
663+
ActiveRecord::Tasks::DatabaseTasks.load_schema(db_config)
666664
ensure
667665
if should_reconnect
668666
ActiveRecord::Base.establish_connection(ActiveRecord::Tasks::DatabaseTasks.env.to_sym)

0 commit comments

Comments
 (0)