Better support for `where()` conditions that use an association name.

Using the name of an association in `where` previously worked only
if the value was a single `ActiveRecrd::Base` object. e.g.

    Post.where(author: Author.first)

Any other values, including `nil`, would cause invalid SQL to be
generated. This change supports arguments in the `where` query
conditions where the key is a `belongs_to` association name and the
value is `nil`, an `Array` of `ActiveRecord::Base` objects, or an
`ActiveRecord::Relation` object.

    # Given the Post model
    class Post < ActiveRecord::Base
      belongs_to :author
    end

    # nil value finds records where the association is not set
    Post.where(author: nil)
    # SELECT "posts".* FROM "posts" WHERE "posts"."author_id" IS NULL

    # Array values find records where the association foreign key
    # matches the ids of the passed ActiveRecord models, resulting
    # in the same query as Post.where(author_id: [1,2])
    authors_array = [Author.find(1), Author.find(2)]
    Post.where(author: authors_array)

    # ActiveRecord::Relation values find records using the same
    # query as Post.where(author_id: Author.where(last_name: "Emde"))
    Post.where(author: Author.where(last_name: "Emde"))

Polymorphic `belongs_to` associations will continue to be handled
appropriately, with the polymorphic `association_type` field added
to the query to match the base class of the value. This feature
previously only worked when the value was a single `ActveRecord::Base`.

    class Post < ActiveRecord::Base
      belongs_to :author, polymorphic: true
    end

    Post.where(author: Author.where(last_name: "Emde"))
    # Generates a query similar to:
    Post.where(author_id: Author.where(last_name: "Emde"), author_type: "Author")
Merge pull request #12873 from martinemde/fix-where-assoc-nil

Better support for AR:B.where(belongs_to_assoc: val) which previously generated invalid SQL
Fix method redefinition warning
Add an application controller for internal controllers
Add mailer previews feature based on mail_view gem
Merge pull request #13332 from rails/pixeltrix/mail_view

WIP: Integration of mail_view gem
use `bin/spring` in release notes. [ci skip]

Follow up to: https://github.com/rails/rails/commit/828a8f214535e59d709fd4862605902d1cc21632#commitcomment-4879462

This will be available after https://github.com/jonleighton/spring/commit/c6e25804b3338959d87a29f40967a333c650c031
is released.
MySQL: remove the old-school 'packets out of order' message

Blast from the past, MySQL 4 era, when the password hashing style changed.
Introduce Module#concerning

A natural, low-ceremony way to separate responsibilities within a class.

Imported from https://github.com/37signals/concerning#readme
Merge pull request #13347 from jeremy/concerning

Introduce Module#concerning
minor doc reword. Upgrade Rails itself not to Rails. [ci skip]

/cc @chancancode
Fix indent on AS changelog [ci skip]
Default I18n.enforce_available_locales to true

We will default this option to true from now on to ensure users properly
handle their list of available locales whenever necessary. This option
was added as a security measure and thus Rails will follow it defaulting
to secure option.

Also improve the handling of I18n config options in its railtie, taking
the new enforce_available_locales option into account, by setting it as
the last one in the process. This ensures no other configuration will
trigger a deprecation warning due to that setting.
Disable available locales checks to avoid warnings running the tests
Add changelog and upgrading notice related to I18n enforce_available_locales handling
Require I18n >= 0.6.9

The option enforce_available_locales is only available on latest
versions, so require the last available one which has the option +
other related fixes and should not have backward compatibility issues.