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
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]
test case to assert that associations do not overwrite after create, fixes #9310
Backport #5808

df36c5f - Fix assert_template assertion with :layout option
4bd05a7 - Fix assert_template :layout => nil assertion
0d19a08 - Improve assert_template layout checking
Merge pull request #9899 from macksmind/backport_5808

Backport #5808
Don't reset inheritance_column when setting explicitly.

This is backported from master (cdfcbc4).
Added changelog for 55e2954