Merge pull request #7850 from senny/5920_postgres_adapter_table_with_capital_letters

postgres, quote table names when fetching the primary key (#5920)
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
Merge pull request #7848 from senny/3415_assert_template_has_nil_variable

can't pass :locals to #assert_template without a view test case (#3415)
Conflicts:
	actionpack/CHANGELOG.md
Accept :remote as symbol in link_to options

Accept either :remote or 'remote' in both the html_options and
(url_)options hash arguments to link_to.
Use the Ruby 1.8 hash syntax
Merge pull request #7865 from teleological/link_to_remote_3_2

Accept :remote as symbol in link_to options (backport)
Backport 1a7049906ee6735bae058e9985a3806d08d9746b

Tag the blank log line between dev requests so it's easier to filter out entire requests with grep -v without leaving a stray newline behind. Example:

  # Tag asset requests so it's easy to filter them from dev logs
  config.log_tags = [
    -> request { :assets if request.path.starts_with?(config.assets.prefix) },
    -> request { request.uuid }
  ]

  # Watch the logs, ignoring asset requests
  $ tail -100f log/development.log | grep -v assets
Eager autoload ActiveRecord association helpers
Eager autoload Preloader classes

Without eager autoloading, these would be autoloaded
only when #preloader_for is called, which is too late
in threaded applications.
Merge pull request #7905 from jfirebaugh/eager_autoload_3-2

Backport eager autoloading fixes
Fix has_many assocation w/select load after create

If you create a new record via a collection association proxy that has
not loaded its target, and which selects additional attributes through
the association, then when the proxy loads its target, it will
inadvertently trigger a deprecation notice during attribute writing when
CollectionAssociation#merge_target_lists attempts to do its thing, since
the newly loaded records will possess attributes the created record does
not.
Merge pull request #7925 from ernie/3-2-fix-collection-associations-with-select

Fix has_many assocation w/select load after create
#7914 get default value when type uses schema name

PostgreSQL adapter properly parses default values when using multiple
schemas and domains.

When using domains across schemas, PostgresSQL prefixes the type of the
default value with the name of the schema where that type (or domain) is.

For example, this query:
```
SELECT a.attname, d.adsrc
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = "defaults"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum;
```

could return something like "'<default_value>'::pg_catalog.text" or
"(''<default_value>'::pg_catalog.text)::text" for the text columns with
defaults.

I modified the regexp used to parse this value so that it ignores
anything between ':: and \b(?:character varying|bpchar|text), and it
allows to have optional parens like in the above second example.
7914 Using a better way to get the defaults from db.

Changes:

* According to postgreSQL documentation:
(http://www.postgresql.org/docs/8.2/static/catalog-pg-attrdef.html)
we should not be using 'adsrc' field because this field is unaware of
outside changes that could affect the way that default values are
represented. Thus, I changed the queries to use
"pg_get_expr(adbin, adrelid)" instead of the historical "adsrc" field.

* Remove parsing of character type default values for 8.1 formatting since
Rails doesn't support postgreSQL 8.1 anymore.

* Remove misleading comment unrelated to code.
Merge pull request #7940 from arturopie/7914-backport-to-3-2-stable

Backport fix of issue #7914 to 3-2-stable
Synchronize around deleting from the reserved connections hash.
Fixes #7955
Merge pull request #4 from rails/3-2-stable

changes from upstream