What should I do to load rails models for rake task which is part of my plugin?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Require the :environment rake task to run before it.
task :my_task => :environment do
end
What should I do to load rails models for rake task which is part of my plugin?
Require the :environment rake task to run before it.
task :my_task => :environment do
end