Rails root poject path added to command

This commit is contained in:
Adam
2016-01-22 15:30:13 +01:00
parent 5fc1279c2a
commit 185cdb2a14

View File

@@ -69,15 +69,15 @@ class ItemsController < ApplicationController
case @task case @task
when 'validate_items' when 'validate_items'
@output = ItemsHelper::execute_command("rake ribica:validate_items") @output = ItemsHelper::execute_command("rake ribica:validate_items -f #{Rails.root}/Rakefile")
@output.collect{|x| x.sub! "\n", "" } @output.collect{|x| x.sub! "\n", "" }
when 'import_items' when 'import_items'
@output = ItemsHelper::execute_command("rake ribica:import_items") @output = ItemsHelper::execute_command("rake ribica:import_items -f #{Rails.root}/Rakefile")
@output.collect{|x| x.sub! "\n", "" } @output.collect{|x| x.sub! "\n", "" }
ItemsHelper::execute_command("rake ribica:reindex") unless RakeTasksHelper::is_error_occurred ItemsHelper::execute_command("rake ribica:reindex -f #{Rails.root}/Rakefile") unless RakeTasksHelper::is_error_occurred @output
when 'update_prices' when 'update_prices'
@output = ItemsHelper::execute_command("rake ribica:update_prices") @output = ItemsHelper::execute_command("rake ribica:update_prices -f #{Rails.root}/Rakefile")
ItemsHelper::execute_command("rake ribica:reindex") ItemsHelper::execute_command("rake ribica:reindex -f #{Rails.root}/Rakefile") unless RakeTasksHelper::is_error_occurred @output
else else
@error_message = "There is no such task" @error_message = "There is no such task"
end end