This is probably really simple: I want a new rake task to collect all
the steps that we need to do to reset the state after changing branches.
The steps needed can be done at the command line as follows:
rake db:reset ttv:seed ttv:develop # initialize the database
rake db:test:load ttv:seed RAILS_ENV=test # initialize the test database
rake test # run tests
So they need to be run in a certain order, and it looks like normal
rake dependencies wouldn''t enforce the order. So a bit of research got
me this which is ugly and anyway doesn''t work right. What''s
the right
way to do it?
desc "Full Reset of DB after changing branches or installation"
task :full_reset => :environment do
Rake::Task[''db:reset''].execute({:RAILS_ENV =>
"development"})
Rake::Task[''ttv:seed''].execute
Rake::Task[''ttv:develop''].execute
Rake::Task[''db:test:load''].execute({:RAILS_ENV =>
"test"})
Rake::Task[''ttv:seed''].execute({:RAILS_ENV =>
"test"})
end
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.