namespace :run_index do task :once => :environment do Extension.es.index_all puts "Index Created for Extension" Template.es.index_all puts "Index Created for Templates" end end