Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

stop loading env when not needed

  • Loading branch information...
commit ca31ae6215d74cde1f05c1a9f7f6d391022924cd 1 parent 34eaaa2
@grosser authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 tasks/acts_as_searchable_tasks.rake
View
8 tasks/acts_as_searchable_tasks.rake
@@ -1,5 +1,4 @@
require File.expand_path("../lib/estraier_admin", File.dirname(__FILE__))
-require File.expand_path("config/environment", RAILS_ROOT)
namespace :search do
desc "Clears HE Index"
@@ -24,14 +23,14 @@ namespace :search do
namespace :node do
desc "Create HE node"
- task :create do
+ task :create => :environment do
raise "Pass a searchable model with MODEL=" unless ENV['MODEL']
model_class = ENV['MODEL'].constantize
admin.create_node(model_class.search_backend.node_name)
end
desc "Delete HE node"
- task :delete do
+ task :delete => :environment do
raise "Pass a searchable model with MODEL=" unless ENV['MODEL']
model_class = ENV['MODEL'].constantize
admin.delete_node(model_class.search_backend.node_name)
@@ -68,5 +67,4 @@ namespace :search do
ENV['SEARCH_INDEX_DIR'] || File.expand_path("tmp/fulltext_index", Dir.pwd)
end
end
-end
-
+end
Please sign in to comment.
Something went wrong with that request. Please try again.