Cleaning up ActiveModel::Dirty tests

* Clarifying what the #changed method returns
* Adding tests to describe what the #changed_attributes returns
* Updating test name based on pull request comment
* Moving the test lower in the file per pull request comment
Revert "Merge pull request #8930 from cordawyn/ordered_railties"

This reverts commit 8348f9ea72c9b50fc4d4462fd9ebe3bba932c783, reversing
changes made to 9dfe2d6f9fabddf9a451a995678a9648c8aaf401.

Reason: this broke railties tests as explained in the issue, and the
author is going to review and report back.

https://github.com/rails/rails/pull/8930#issuecomment-12272671
Update guides/source/active_record_validations.md

Duplicated `update`
Raise correct exception now Journey is integrated.

Now that Journey has been integrated into ActionDispatch we can raise
the exception ActionController::UrlGenerationError directly rather than
raising the internal Journey::Router::RoutingError and then have
ActionDispatch::Routing::RouteSet#generate re-raise the exception.
Ensure port is set when passed via the process method
Add support for other types of routing constraints

This now allows the use of arrays like this:

  get '/foo/:action', to: 'foo', constraints: { subdomain: %w[www admin] }

or constraints where the request method returns an Fixnum like this:

  get '/foo', to: 'foo#index', constraints: { port: 8080 }

Note that this only applies to constraints on the request - path
constraints still need to be specified as Regexps as the various
constraints are compiled into a single Regexp.
Change the behavior of route defaults

This commit changes route defaults so that explicit defaults are no
longer required where the key is not part of the path. For example:

  resources :posts, bucket_type: 'posts'

will be required whenever constructing the url from a hash such as a
functional test or using url_for directly. However using the explicit
form alters the behavior so it's not required:

  resources :projects, defaults: { bucket_type: 'projects' }

This changes existing behavior slightly in that any routes which
only differ in their defaults will match the first route rather
than the closest match.

Closes #8814
use case statement
allow :dirs option for .enumerate

Allows custom rake tasks to be defined using:

  SourceAnnotationExtractor.enumerate 'TODO|FIXME', dirs: %w(app lib), tag: true
Merge pull request #8940 from adomokos/adding_tests_for_changed_attributes

Cleaning up ActiveModel::Dirty tests
Merge pull request #8954 from davetoxa/patch-1

Update guides/source/active_record_validations.md
Remove header bloat introduced by BestStandardsSupport middleware

The same headers were being duplicated on every request.
strong parameters exception handling
Merge pull request #8914 from nilbus/fix-header-bloat

Remove header bloat introduced by BestStandardsSupport middleware
Merge pull request #8958 from balexand/strong_parameters_exception_handling

Strong parameters exception handling
Merge pull request #8955 from burns/source_annotation

Allow a `:dirs` option to `SourceAnnotationExtractor.enumerate`
adding regression test in master for #8631
Merge pull request #8963 from asanghi/regress_8631

adding regression test in master for #8631
Remove warnings: "(...) interpreted as grouped expression"
Don't rely on Hash key's ordering

If we set encoding latin1 for a PostgreSQL database, it calls
PostgreSQLAdapter::create_database with options that have,
among other things:

  { 'encoding' => 'latin1' }

Then, we use reverse_merge(:encoding => "utf8") to setup the default
encoding. In the end, the hash looks like:

  { :encoding => 'utf8', 'encoding' => 'latin1' }

The call to options.symbolize_keys calls to_sym on each_key of this
Hash. It usually means that the encoding passed overwrites the default
utf8, but it's not guaranteed. So, we shouldn't rely on it.

The same was happening in ActiveRecord::ConnectionHandling.