Merge pull request #12463 from ulyssecarion/master

Call `rails plugin new yaffle` in the plugins guide. [ci skip]
Merge pull request #12473 from claudiob/document-after-touch

Add documentation for after_touch [ci skip]
Merge pull request #12283 from JuanitoFatas/rails-on-rack

[ci skip] Add explanation on Rack::Sendfile middleware in rails_on_rack.md.
Respect `SCRIPT_NAME` when using `redirect` with a relative path

Example:
    # application routes.rb
    mount BlogEngine => '/blog'

    # engine routes.rb
    get '/admin' => redirect('admin/dashboard')

This now redirects to the path `/blog/admin/dashboard`, whereas before it
would've generated an invalid url because there would be no slash between
the host name and the path. It also allows redirects to work where the
application is deployed to a subdirectory of a website.

Fixes #7977
(cherry picked from commit 9dbd208562ccd3d68009a72d37cbfe29b94f98c4)

Conflicts:
	actionpack/CHANGELOG.md
Use bcrypt's public cost attr, not internal constant

See:

- https://github.com/codahale/bcrypt-ruby/pull/63
- https://github.com/codahale/bcrypt-ruby/pull/64
- https://github.com/codahale/bcrypt-ruby/pull/65
Merge pull request #12494 from tjschuck/bcrypt_cost_attr

Use bcrypt's public cost attr, not internal constant
`CollectionProxy#include?` returns `true` and `false` as documented.
Merge pull request #12507 from malavbhavsar/doc_patch

Some fixes in docs [ci skip]
Conflicts:
	guides/source/active_record_basics.md
Merge pull request #11791 from versioncontrol/includes_with_persistent_select

Includes with persistent select, fixes #11773
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/finder_methods.rb
Merge pull request #12493 from drodriguez/patch-1

Keep code consistent with previous code blocks.
Merge pull request #12491 from shamanime/patch-1

Fix wrong variable name used in the select_day method documentation
Merge pull request #12511 from jetthoughts/informative_raise_message_for_incorrect_association

Make missed association exception message more informative
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/associations/preloader.rb
Extract local variable to avoid method call
Merge pull request #12508 from jetthoughts/12415_generate_subqueries_for_relation_from_binding_params

Generate subquery for Relation passed as array condition for where

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
Dump the default function when the primary key is uuid

Fixes #12489
Push default_function to superclass to avoid method check
Extract a function to determine if the default value is a function
Merge branch 'default_function' into 4-0-stable
use arel rather than slapping together SQL strings
Merge pull request #11880 from senny/backport_arel_fix

Backport arel fix