title: Do rails rake tasks provide access to ActiveRecord models?
body: <p>I am trying to create a custom rake task, but it seems I dont have access to my models. I thought this was something implicitly included with rails task.</p>
  
  <p>I have the following code in lib/tasks/test.rake:</p>
  
  <pre><code>namespace :test do
    task :new_task do
      puts Parent.all.inspect
    end
  end
  </code></pre>
  
  <p>And here is what my parent model looks like:</p>
  
  <pre><code>class Parent &lt; ActiveRecord::Base
    has_many :children
  end
  </code></pre>
  
  <p>It's a pretty simple example, but I get the following error:</p>
  
  <pre><code>/&gt; rake test:new_task
  (in /Users/arash/Documents/dev/soft_deletes)
  rake aborted!
  uninitialized constant Parent
  
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>Any ideas? Thanks</p>