Fix human attribute_name to handle deeply nested attributes

When a model nests another model that also nests yet another model
using accepts_nested_attributes_for method, its Errors object can
have an attribute name with "contacts.addresses.street" style.

In this case, the dots within the namespace should be substituted
with slashes so that we can provide the translation under the
"activemodel.attributes.person/contacts/addresses.street" key.

This commit is related to #3859.
Fix logs name consistency.
Properly discover a connection is closed in postgresql_adapter

PQstatus doesn't properly test if future operations will succeed. A
PQping function is added to libpq in PostgreSQL 9.1, but if we rely
on it, everyone on earlier versions of Postgres is out of luck,
and the pg gem wouldn't have the 'fix' until the next release.

Thanks to @cbrecabarren and @ged for handling all the dirty details.

Closes #3392.
Cache metadata in advance to avoid extra sql statements while testing.

Reason: If metadata is not cached extra sql statements
will be executed, which causes failures tests with assert_queries().
Make connection pool fair with respect to waiting threads.

The core of this fix is a threadsafe, fair Queue class.  It is
very similar to Queue in stdlib except that it supports waiting
with a timeout.

The issue this solves is that if several threads are contending for
database connections, an unfair queue makes is possible that a thread
will timeout even while other threads successfully acquire and release
connections.  A fair queue means the thread that has been waiting the
longest will get the next available connection.

This includes a few test fixes to avoid test ordering issues that
cropped up during development of this patch.
add small note about how to get the full list of options for rails plugin new
Small correction to contributing_to_rails in the section for testing ActiveRecord

Initially the guide suggests to install gems via "bundle install --without db" 
But tests for ActiveRecord need to install the gems in db group also, like mysql.
The patch clears the bundler options in ".bundle/config" and installs all the gems in Gemfile
Revert "Small correction to contributing_to_rails in the section for testing ActiveRecord"This reverts commit 0cfbaa030a0684aaa89d3d3c85528e80c1995836.Sorry did not see the section on MySql and PostgreSQL# Please enter the commit message for your changes. Lines starting# with '#' will be ignored, and an empty message aborts the commit.# On branch master# Changes to be committed:#   (use "git reset HEAD <file>..." to unstage)##	modified:   guides/source/contributing_to_ruby_on_rails.textile#
[guides] Add :guides namespace and :html and :kindle tasks to Rakefile
[guides] Add rake task to show help and make it the default one
Add some information about handle_unverified_request to guides.
add examples to Hash#deep_stringify_keys and Hash#deep_symbolize_keys [ci skip]
update Hash documentation with 1.9 syntax [ci skip]
add CollectionProxy#uniq documentation
remove unnecessary ruby 1.8 reference from active_record/core [ci skip]
update Module#mattr_accessor documentation [ci skip]
Fix railties_order when application object is passed

railites_order method, introduced in 40b19e0, had a bug that was causing
loading application instance twice in initializers if railties_order
already included application instance. So for example

    railties_order = [Foo::Engine, :main_app, Bar::Engine]

would result in such railties array:

    [MyApp::Application, Foo::Engine, MyAppApplication, Bar::Engine]

In order to fix it, we need to check for existence of application in
both railties_order and railties arrays.
copy edits [ci skip]
Merge branch 'master' of github.com:lifo/docrails
some asset path changes and formatting fixes in AV overview [ci skip]