开发者

task :something => :environment

开发者 https://www.devze.com 2023-01-08 05:54 出处:网络
Can someone explain me what happens when 开发者_如何转开发I add such dependency to my tasks? Which files are loaded etc.?All this dependency does is requiring your config/environment.rb file, ie. load

Can someone explain me what happens when 开发者_如何转开发I add such dependency to my tasks? Which files are loaded etc.?


All this dependency does is requiring your config/environment.rb file, ie. loading the entire Rails environment. You can do this whenever you need to use any code from your application in the rake tasks (ie. models), which is quite common.

0

精彩评论

暂无评论...
验证码 换一张
取 消