So I have a rake task that runs regularly and afterwards I need to create my indexes again, is there a way I can call those methods directly in ruby without resorting to sending them to the system to execute like this:
task :mytask => :environment do
# do stuff...
`bundle exec rake db:mongoid:create_indexes`
end
You can make direct calls to other rake tasks in your application with
Rake::Task. So your above code could become: