Merge pull request #14679 from pbharadiya/master

Correct factual error for page not found [ci skip]
Require action_controller before any other action_controller file

This will load properly the loading hooks.

Closes rails/sass-rails#205
Merge pull request #12829 from iantropov/issue_insert_via_hmt_scope_3548

Fix insertion of records for hmt association with scope

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
docs, make association `autosave: true` examples runnable. Closes #14700

[ci skip]

The examples are written in a way you expect them to be executable.
However one snippet assumed there to be two comments when only one
was created above.

The defined models did not extend `ActiveRecord::Base`

The example used `comments.last.mark_for_destruction`. This does no
longer load the whole collection but just the last record. It is
then refetcht on subsequent calls to `last`. This breaks the example.
Merge pull request #14684 from Futurelearn/jc-deep-nested-shallow-url-helper-bug

Add a failing test for a URL helper that was broken by a6b9ea2.

(cherry picked from commit 142448259d7f450df49fdac06bf912edfecaa633)

Conflicts:
	actionpack/CHANGELOG.md
Merge pull request #14689 from matthewd/asset_initializer

Move assets precompile (and version) to an initializer
Conflicts:
	railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt
Fix version indicator on guides and link to Rails 4.0 [ci skip]
Merge branch 'rm-fix-13648'

Includes https://github.com/rails/rails/pull/14711 and some cleanup
commits.

Fixes #13648

Conflicts:
	activerecord/CHANGELOG.md
Check if the `request` variable isn't nil when calling render_to_string

closes #14125
PostgreSQL, warn once per connection per missing OID. Closes #14275.

[Yves Senn & Matthew Draper]

(cherry picked from commit 9f62344d9552f0a58e4aa43ca6f1a7fec273a04e)

This is a partial backport of #14692.

Conflicts:
    activerecord/CHANGELOG.md
    activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
    activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
Merge pull request #14592 from laurocaetano/equality_between_relation_and_collection_proxy

The comparison between `Relation` and `CollectionProxy` should be consistent.

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #14739 from oysta/guide-fixes

Fix some inconsistent references between text and example code in getting started guide [ci skip]
docs, double meaning of `serialize` argument. Closes #14284.

The second argument to serialize has double meaning:
  * `class_name` of the Type to serialize
  * `coder` to use then serializing.

The new variable name and the docs better describe that behavior.
Merge pull request #14736 from nashby/hidden-index

`collection_check_boxes` respects `:index` option for the hidden filed name
Conflicts:
	actionview/lib/action_view/helpers/tags/collection_check_boxes.rb
	actionview/test/template/form_collections_helper_test.rb
Use the index on hidden field
Return null type format when format is not know

When requesting a controller with the following code with a unknown format:

    def my_action
      respond_to do |format|
        format.json { head :ok }
        format.any { render text: 'Default response' }
      end
    end

we should render the default response instead of raising ActionController::UnknownFormat

Fixes #14462

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/test/controller/mime/respond_with_test.rb
Make console and generators blocks works at Application instance level

Like rake tasks and runner blocks these blocks should also being shared
between applications since they are stored at the classes.

Fixes #14748

Conflicts:
	railties/test/application/configuration_test.rb
Merge pull request #14728 from stomar/assertion-msg

Remove surplus period from assertion messages
Merge pull request #14758 from JuanitoFatas/migrations-md

[ci skip] Add missing end in one of the examples in Migrations.md.
Merge pull request #14756 from laurocaetano/fix-count-on-association-relation

Fix count on association relation (calls to empty and size).