Rake 任务:如何从另一个名称空间创建任务先决条件?
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
感谢您的帮助。
rake tasks allow to define a list of other tasks that need to run before as a prerequesite, i.e.
namespace :import do
task :products => [:environment, :tax_categories] do
... # create products from import and reference tax categories
end
end
However, how could i reference the tax_categories task if it was defined in another namespace, like
namespace :init do
task :tax_categories => :environment do
... # create tax categories
end
end
Thanks for the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能可以这样做,但不知道这是否是推荐的方式:
You could probably do this, but dont know if this is the recommended way: