Accept belongs_to assoc. keys in ActiveRecord queries

Allows you to specify the model association key in a belongs_to
relationship instead of the foreign key.

The following queries are now equivalent:

Post.where(:author_id => Author.first)
Post.where(:author => Author.first)

PriceEstimate.where(:estimate_of_type => 'Treasure', :estimate_of_id => treasure)
PriceEstimate.where(:estimate_of => treasure)
fixed support for DATABASE_URL for rake db tasks
- added tests to confirm establish_connection uses DATABASE_URL and
  Rails.env correctly even when no arguments are passed in.
- updated rake db tasks to support DATABASE_URL, and added tests to
  confirm correct behavior for these rake tasks.  (Removed
  establish_connection call from some tasks since in those cases
  the :environment task already made sure the function would be called)
- updated Resolver so that when it resolves the database url, it
  removes hash values with empty strings from the config spec (e.g.
  to support connection to postgresql when no username is specified).
Merge pull request #7521 from graceliu/fix_database_url_support

Fixed support for DATABASE_URL for rake db tasks
Added additional comments on how to use the "type" column without
single-table inheritance by overriding it in your ActiveRecord
Model.
Merge pull request #7605 from revans/master

Add docs to inheritance_column method, explaining how to override it
to be able to use the "type" column without STI [ci skip]
Use the SynchronousQueue as default in production and development.

We should not let the users use the ThreadedConsumer without know about
the risks
Allow users to configure the queue for the mailers

This allow the users to do:

    config.action_mailer.queue = MyQueue.new

and

    class UsersMailer < ActionMailer::Base
      self.queue = MyQueue.new
    end
Define a SynchronousQueue for test in Action Pack.

We don't need to rely on rails/queueing in Action Pack tests
Updating the documentation to ActionMailer::Base.queue
Remove the queue configuration from the environments templates since the
default is the SynchronousQueue.
Update documentation for CollectionProxy
Merge pull request #7622 from marcandre/doc

Update documentation for CollectionProxy [ci skip]
Merge pull request #7273 from beerlington/foreign_key_model_queries

Convert model name to foreign key in queries
Fix nested association references

Previously the reflection would be looked up on the wrong class. However
the test passed because the examples referred back to themselves.
Refactor to remove some duplication
Pass in the model class rather than engine

In some circumstances engine was Arel::Table.engine which for separate
reasons was an ActiveRecord::Model::DeprecationProxy, which caused a
deprecation warning.

In any case, we want the actual model class here, since we want to use
it to infer information about associations.
change app/plugin generators to be more SCM agnostic

Users of other SCM's can now generate rails
apps that will add the "empty" directories to source control,
but will not have a useless .gitignore or mis-named .gitkeep
files.

* Change `rails new` and `rails plugin new` generators to name
  the `.gitkeep` as `.keep` in a more SCM-agnostic way.

* Change `--skip-git` option to only skip the `.gitignore` file
  and still generate the `.keep` files.

* Add `--skip-keeps` option to skip the `.keep` files.

It closes #2800.
Merge pull request #7614 from frodsan/scm_agnostic

add --skip-ignore and --skip-keeps options to generators.
update ConnectionAdaptar::Column#type_cast_code to be compatible with 3.2 branch
Merge pull request #7623 from tchandy/master

update ConnectionAdapter::Column#type_cast_code to be compatible with rails 3.2 branch