app/controllers/admin/dashboard_controller.rb in kit_cms-2.3.9 vs app/controllers/admin/dashboard_controller.rb in kit_cms-2.3.10

- old
+ new

@@ -1,7 +1,7 @@ class Admin::DashboardController < AdminController - layout "cms-boxed" + layout "cms" def user_comment comment = Comment.sys(_sid).where(:id=>params[:id]).first if comment @@ -355,14 +355,23 @@ @@to_search = [ "Page", "User", "Help", "Category", "Asset", "TopicPost", "TopicThread", "FormSubmission"] def reindex @@to_search.each do |model| - force_class = model.constantize.new - eval("#{model}.index.delete") rescue nil - eval("#{model}.create_elasticsearch_index") - eval("#{model}.import :per_page=>5000") + modelk = Kernel.const_get(model) + + modelk.index.delete rescue nil + modelk.create_elasticsearch_index + + if params[:slow] + modelk.find_each do |record| + logger.info "Importing #{model} #{record.id}" + modelk.index.store record + end + else + modelk.import :per_page=>1000 + end end flash[:notice] = "Reindex complete" redirect_to "/db" end @@ -417,10 +426,10 @@ @activity = @activity.order("created_at desc").page(params[:page]).per(100) if request.xhr? render :partial=>"activity_list" else - render "activity", :layout=>"cms-boxed" + render "activity", :layout=>"cms" end end def help if params[:search]