task :something => :environment
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.
精彩评论