Merge pull request #9010 from vipulnsward/remove_extra_sort_from_test

Remove extra sort from test
Merge pull request #9001 from schneems/schneems/routes-path-js

In Browser Path Matching with Javascript
Standardise the return value of `to_time`

This commit standardises the return value of `to_time` to an instance
of `Time` in the local system timezone, matching the Ruby core and
standard library behavior.

The default form for `String#to_time` has been changed from :utc to
:local but research seems to suggest the latter is the more common form.

Also fix an edge condition with `String#to_time` where the string has
a timezone offset in it and the mode is :local. e.g:

  # Before:
  >> "2000-01-01 00:00:00 -0500".to_time(:local)
  => 2000-01-01 05:00:00 -0500

  # After:
  >> "2000-01-01 00:00:00 -0500".to_time(:local)
  => 2000-01-01 00:00:00 -0500

Closes #2453
Use `DateTime.parse` inside `String#to_datetime`

Use the standard library's `DateTime.parse` because it's marginally
faster and supports partial date/time strings.

Benchmark:
       user     system      total        real
old  3.980000   0.000000   3.980000 (  3.987606)
new  3.640000   0.010000   3.650000 (  3.641342)
Added AR integration tests for form helpers
Merge pull request #9014 from virusman/form_helpers_ar_tests

AR integration tests for form helpers
Merge pull request #8671 from xuanxu/fix_irregular

Inflector irregular singularize rules
adding comma to separate clauses
slices less, reads better
resistance is futile
Duplicate possible frozen string from route

Ruby 1.9 freezes Hash string keys by default so where a route is
defined like this:

  get 'search' => 'search'

then the Mapper will derive the action from the key. This blows up
later when the action is added to the parameters hash and the
encoding is forced.

Closes #3429
Refactored transaction state into its own object. Each transaction creates a new transaction state object upon initialization.
Merge pull request #9011 from wangjohn/activerecord_transaction_state

Refactored TransactionState into its own class
document how to create custom rails environments
Merge pull request #9019 from senny/doc_custom_rails_env

document how to create custom rails environments
copy-edits 7e6e4f2 [ci skip]

Capitalization in the title of the section, enumerates the environments
in the usual order, adds a paragraph, and tries to use less "you"s.
Fix asset_path in mounted engine

Historically serving assets from a mountable engine could be achieved by
running ActionDispatch::Static as a part of engine middleware stack or
to copy assets prefixed with an engine name. After introduction of
assets pipeline this is not needed as all of the assets are served or
compiled into main application's assets.

This commit removes the obsolete line making asset_path always generate
paths relative to the root or config.relative_url_root if it's set.

(closes #8119)
Missing repair_validations
Reset table_name_{prefix,suffix}, and table_name after each test

because some tests were not resetting them, and thus the tests were order dependent
Ignore "SHOW search_path" when counting PostgreSQL queries