in classic rake example we can load all rails environment with all models in taks with:
desc "Pick a last user name"
task :winner => :environment do
puts "Last user: #{User.last.name}"
end
I have very large rails project so it takes a lot of time to load all models and dependencies. Is any way to load rails with just specific model or set of models?
I'm about to write custom rails loader but don't want to invent bycicle ;) Maybe some gem or good custom loader example already exist?
I think it would be useful for some cases of resque workers as well. Thanks!