title: ActiveRecord::ConnectionNotEstablished within a rake task
body: <p>I'm working to create a rake task to remove a few tables and triggers.</p>
  
  <p>My rake task:</p>
  
  <pre><code>task :remove_rubyrep do
    sql = &lt;&lt;-SQL
      DROP TABLE rr_logged_events, rr_running_flags, rr_pending_changes;
    SQL
    ActiveRecord::Base.establish_connection
    ActiveRecord::Base.connection.execute(sql)
  end
  </code></pre>
  
  <p>I tried running this like so:</p>
  
  <pre><code>rake remove_rubyrep
  RAILS_ENV=development rake remove_rubyrep
  </code></pre>
  
  <p>Problem is the rake tasks errors with: </p>
  
  <pre><code>rake aborted!
  ActiveRecord::ConnectionNotEstablished
  </code></pre>
  
  <p>Any suggestions on how to allow the rake task to connect to the DB to execute the raw sql? Thanks</p>