diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index 656961fd3..5db6f631b 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -314,6 +314,13 @@ namespace :growstuff do end end end + + desc "January 2015: build Elasticsearch index" + task :elasticsearch_create_index => :environment do + Crop.__elasticsearch__.create_index! force: true + Crop.import + end + end # end oneoff section end diff --git a/spec/support/elasticsearch_helpers.rb b/spec/support/elasticsearch_helpers.rb deleted file mode 100644 index 0e80ea321..000000000 --- a/spec/support/elasticsearch_helpers.rb +++ /dev/null @@ -1,18 +0,0 @@ -module ElasticsearchHelpers - def sync_elasticsearch(crops) - if ENV['GROWSTUFF_ELASTICSEARCH'] == "true" - crops.each {|crop| crop.__elasticsearch__.index_document} - Crop.__elasticsearch__.refresh_index! - end - end -end - -RSpec.configure do |config| - config.include ElasticsearchHelpers - - config.before(:each) do - if ENV['GROWSTUFF_ELASTICSEARCH'] == "true" - Crop.__elasticsearch__.create_index! force: true - end - end -end \ No newline at end of file