Do rails rake tasks provide access to ActiveRecord models?

Figured it out, the task should look like:

namespace :test do
  task :new_task => :environment do
    puts Parent.all.inspect
  end
end

Notice the => :environment dependency added to the task

Leave a Comment