aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/railties
diff options
context:
space:
mode:
authorArthur Neves <arthurnn@gmail.com>2013-12-13 16:04:46 -0500
committerArthur Neves <arthurnn@gmail.com>2013-12-14 17:33:50 -0500
commitb3a806b7b2179fc588465fee728fe837cf8d4940 (patch)
tree5605c8276aa02fef80e7a34081938d70edad0e18 /activerecord/lib/active_record/railties
parent12affbe491e4ad7056c7bc1555cf223129cb2745 (diff)
downloadrails-b3a806b7b2179fc588465fee728fe837cf8d4940.tar.gz
rails-b3a806b7b2179fc588465fee728fe837cf8d4940.tar.bz2
rails-b3a806b7b2179fc588465fee728fe837cf8d4940.zip
db:test:clone and prepare must load environment
db:test:clone and db:test:prepare use ActiveRecord::Base. configurations, so we need to load the rails environment, otherwise the config wont be in place.
Diffstat (limited to 'activerecord/lib/active_record/railties')
-rw-r--r--activerecord/lib/active_record/railties/databases.rake5
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake
index 52b3d3e5e6..0fdfed991c 100644
--- a/activerecord/lib/active_record/railties/databases.rake
+++ b/activerecord/lib/active_record/railties/databases.rake
@@ -343,7 +343,7 @@ db_namespace = namespace :db do
end
# desc "Recreate the test database from a fresh schema"
- task :clone do
+ task :clone => :environment do
case ActiveRecord::Base.schema_format
when :ruby
db_namespace["test:clone_schema"].invoke
@@ -364,7 +364,7 @@ db_namespace = namespace :db do
end
# desc 'Check for pending migrations and load the test schema'
- task :prepare => :load_config do
+ task :prepare => [:environment, :load_config] do
unless ActiveRecord::Base.configurations.blank?
db_namespace['test:load'].invoke
end
@@ -401,4 +401,3 @@ namespace :railties do
end
task 'test:prepare' => ['db:test:prepare', 'db:test:load', 'db:abort_if_pending_migrations']
-