Sha256: 6342609a2ad6f569fc14d80ee13f8788312733841373058b55fe50b1a0e6d2c7
Contents?: true
Size: 697 Bytes
Versions: 3
Compression:
Stored size: 697 Bytes
Contents
require "rake" namespace :searchkick do desc "reindex model" task reindex: :environment do if ENV["CLASS"] klass = ENV["CLASS"].constantize rescue nil if klass klass.reindex else abort "Could not find class: #{ENV['CLASS']}" end else abort "USAGE: rake searchkick:reindex CLASS=Product" end end if defined?(Rails) namespace :reindex do desc "reindex all models" task all: :environment do Rails.application.eager_load! Searchkick.models.each do |model| puts "Reindexing #{model.name}..." model.reindex end puts "Reindex complete" end end end end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
searchkick-0.9.1 | lib/searchkick/tasks.rb |
searchkick-sinneduy-0.9.0 | lib/searchkick/tasks.rb |
searchkick-0.9.0 | lib/searchkick/tasks.rb |