Don't create fibers just to iterate
Terminate the backend ourselves on PG 9.2+

This should make it harder to accidentally break this test.
Merge pull request #14036 from matthewd/pg_terminate_backend_4-0-stable

4-0-stable: Terminate the backend ourselves on PG 9.2+
Merge pull request #14034 from hdabrows/drop-correct-index-when-reverting-migration

Drop the correct index after reverting a migration
Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #14059 from tbpgr/guides_active_support_core_ext

[Guides] fix guide active_support_core_extensions. add Note to String#indent [ci skip]
Merge pull request #14072 from robin850/patch-16

Add a missing changelog entry for #13981 and #14035
Resolve encoding issues with arrays of hstore (bug 11135).

We didn't have enough encoding for the wire protocol to store an array
of hstore types. So, further encode any hstore that is an array member.
Whilst we're here, ensure it's an HashWithIndifferentAccess being
returned, to be consistent with other serialized forms, and add testing
for arrays of hstore.

So now the following migration:

  enable_extension "hstore"
  create_table :servers do |t|
    t.string  :name
    t.hstore  :interfaces, array: true
  end

produces a model that can used like this, to store an array of hashes:

  server = Server.create(name: "server01", interfaces: [
    { name: "bge0", ipv4: "192.0.2.2", state: "up" },
    { name: "de0", state: "disabled", by: "misha" },
    { name: "fe0", state: "up" },
  ])

More at http://inopinatus.org/2013/07/12/using-arrays-of-hstore-with-rails-4/
Merge pull request #14078 from gsamokovarov/hstore_arrays_fix_4_0

Backport #13512 to 4.0 stable
Escape format, negative_format and units options of number helpers

Previously the values of these options were trusted leading to
potential XSS vulnerabilities.

Fixes: CVE-2014-0081
Correctly escape PostgreSQL arrays.

Thanks Godfrey Chan for reporting this!

Fixes: CVE-2014-0080
Preparing for 4.0.3 release
Merge branch '4-0-3' into 4-0-stable

Conflicts:
	actionpack/CHANGELOG.md
	activerecord/CHANGELOG.md
Use the reference for the mime type to get the format

Before we were calling to_sym in the mime type, even when it is unknown
what can cause denial of service since symbols are not removed by the
garbage collector.

Fixes: CVE-2014-0082
Merge branch 'refs/heads/4-0-stable' into record-name-conflict-4-0-stable