lib/parallel_tests/tasks.rb in parallel_tests-0.4.17 vs lib/parallel_tests/tasks.rb in parallel_tests-0.4.18
- old
+ new
@@ -16,10 +16,10 @@
run_in_parallel('rake db:drop RAILS_ENV=test', args)
end
desc "update test databases by dumping and loading --> parallel:prepare[num_cpus]"
task(:prepare, [:count] => 'db:abort_if_pending_migrations') do |t,args|
- if ActiveRecord::Base.schema_format == :ruby
+ if defined?(ActiveRecord) && ActiveRecord::Base.schema_format == :ruby
# dump then load in parallel
Rake::Task['db:schema:dump'].invoke
Rake::Task['parallel:load_schema'].invoke(args[:count])
else
# there is no separate dump / load for schema_format :sql -> do it safe and slow