Commit 7d18cca531aa1e58c9fbc3c86f84b70387d91dde

Authored by Rajesh Rajappan
1 parent 295bd668

rendexing message added

Showing 1 changed file with 4 additions and 0 deletions   Show diff stats
lib/searchkick/tasks.rb
... ... @@ -21,10 +21,14 @@ namespace :searchkick do
21 21 namespace :reindex do
22 22 desc "reindex all models"
23 23 task :all => :environment do
  24 + dir = ENV['DIR'].to_s != '' ? ENV['DIR'] : Rails.root.join("app/models")
  25 + puts "Loading models from: #{dir}"
24 26 Rails.application.eager_load!
25 27 (Searchkick::Reindex.instance_variable_get(:@descendents) || []).each do |model|
  28 + puts "Reindexing #{model.name.try(:pluralize)} ..."
26 29 model.reindex
27 30 end
  31 + puts "Reindexing Done."
28 32 end
29 33 end
30 34  
... ...