Small refactor on db:reset

db:reset should not prematurely load the environment, so, for instance,
if there is any initializer that touches th DB, it will not touch that
before droping it.

Also this makes the code simpler.

This changed was made back in 15fb4302b6ff16e641b6279a3530eb8ed97f2899
, not sure why. But I am pretty much sure we should do it like this, as
drop and setup should load its dependencies tasks if necessary.
This commit is contained in:
Arthur Neves 2015-06-15 21:23:09 +02:00
parent feff9595fb
commit 68f6d5346c
No known key found for this signature in database
GPG Key ID: 04A390FB1E433E17

@ -134,10 +134,7 @@ db_namespace = namespace :db do
end
# desc 'Drops and recreates the database from db/schema.rb for the current environment and loads the seeds.'
task :reset => [:environment, :load_config] do
db_namespace["drop"].invoke
db_namespace["setup"].invoke
end
task :reset => [ 'db:drop', 'db:setup' ]
# desc "Retrieves the charset for the current environment's database"
task :charset => [:environment, :load_config] do