3 # for a shared index, declare all models that should go into this index separated by
4 # space: MODEL="MyModel AnotherModel"
5 desc "Rebuild a Ferret index. Specify what model to rebuild with the MODEL environment variable."
7 require File.join(RAILS_ROOT, 'config', 'environment')
9 models = ENV['MODEL'].split.map(&:constantize)
12 models.first.rebuild_index( *models )
14 # update records that have changed since the rebuild started
16 m.records_modified_since(start).each do |object|