backport runner fixes to 3-2-stable

Add a runner hook to Rails::Application and Rails::Engine that requires
ActiveRecord::Base to avoid circular constant loading when using observers.

This commit backports cc7dd66, c0ba0f0 and 8d01c61.
adding test for CVE
Backport #9347 to rails 3.2
Merge pull request #9804 from samsonasu/backport_number_to_human_fixes

Backport #9347 to rails 3.2
Reset postgreSQL search path in db:test:clone_structure.
This patch resets the postgres search path in the structure.sql after
the structure is dumped in order to find schema_migrations table when
multiples schemas are used.

Fixes #945
Merge pull request #9796 from dembskoi/clone_structure

Reset postgreSQL search path in db:test:clone_structure.
Be consistent with quotes in smtp example guide [ci skip]
Fixed assets loading performance in 3.2.13

The PR #8756 uses Sprockets for resolving files that already exists on disk, for those files their extensions don't need to be rewritten.

Fixes #9803
Don't crash exception translation w/ nil result attribute.

Exception.result is nil when attempting a query after PostgreSQL
disconnect, resulting in new exception:
NoMethodError: undefined method `error_field' for nil:NilClass
Wrong exception is occured when raising no translatable exception

Conflicts:
	activerecord/CHANGELOG.md
Remove bad changelog entry from AR [ci skip]

Introduced in dc2bc388bc8c6c345337052bf0d60f5243d899d4.
Merge pull request #9802 from newsline/fix-broken-action-missing

Fix missing action_missing

Conflicts:
	actionpack/CHANGELOG.md

Conflicts:
	actionpack/test/controller/base_test.rb

Fixes #9799
Added changelog for 687e68d
Merge branch '3-2-stable' into fredwu-slow_view_loading_fix

* 3-2-stable:
  Merge pull request #9802 from newsline/fix-broken-action-missing
  Remove bad changelog entry from AR [ci skip]
  Wrong exception is occured when raising no translatable exception
  Don't crash exception translation w/ nil result attribute.

Conflicts:
	actionpack/CHANGELOG.md
Improve CHANGELOG entry [ci skip]
Fix test to Ruby 1.8

Pathname doesn't respond to to_path
do not reset associations when preloading twice.

Closes #9806.

As the `through_options` always contained `{:order=>nil}` the second time,
the preloader ran, the association was always reset. This patch only
adds the `:order` to the `through_options` if it is set.
Merge pull request #9870 from senny/9806_eager_loading_regression

do not reset associations when preloading twice.
use ruby 1.8 Hash syntax [ci skip]
Merge pull request #9873 from senny/use_old_hash_syntax

use ruby 1.8 Hash syntax [ci skip]