rake タスクを使用すると、事前に実行する必要がある他のタスクのリストを定義できます。つまり、
namespace :import do
task :products => [:environment, :tax_categories] do
... # create products from import and reference tax categories
end
end
ただし、tax_categories タスクが別の名前空間で定義されている場合、どのように参照できますか?
namespace :init do
task :tax_categories => :environment do
... # create tax categories
end
end
助けてくれてありがとう。