Merge pull request #12137 from lann/fix_association_first_last

Make CollectionAssociation first/last with integer fetch with query

Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #12129 from Empact/deprecate-array-bang-delegation

Deprecate the delegation of Array bang methods in ActiveRecord::Delegation

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/relation_test.rb
Update 3_2_release_notes.md

Fixed typo and applied proper code highlighting.
Missing destroy command
Moved all JSON core extensions into core_ext/object/json

TL;DR The primary driver is to remove autoload surprise.

This is related to #12106. (The root cause for that ticket is that
json/add defines Regexp#to_json among others, but here I'll reproduce
the problem without json/add.)

Before:

   >> require 'active_support/core_ext/to_json'
   => true
   >> //.as_json
   NoMethodError: undefined method `as_json' for //:Regexp
     from (irb):3
     from /Users/godfrey/.rvm/rubies/ruby-2.0.0-p195/bin/irb:16:in `<main>'
   >> //.to_json
   => "\"(?-mix:)\""
   >> //.as_json
   => "(?-mix:)"

After:

   >> require 'active_support/core_ext/to_json'
   => true
   >> //.as_json
   => "(?-mix:)"

This is because ActiveSupport::JSON is autoloaded the first time
Object#to_json is called, which causes additional core extentions
(previously defined in active_support/json/encoding.rb) to be loaded.

When someone require 'active_support/core_ext', the expectation is
that it would add certain methods to the core classes NOW. The
previous behaviour causes additional methods to be loaded the first
time you call `to_json`, which could cause nasty surprises and other
unplesant side-effects.

This change moves all core extensions in to core_ext/json. AS::JSON is
still autoloaded on first #to_json call, but since it nolonger
include the core extensions, it should address the aforementioned bug.

*Requiring core_ext/object/to_json now causes a deprecation warnning*
Fix typos: the indefinite articles(a -> an)
Merge pull request #12216 from suginoy/a-an

Fix typos: the indefinite articles(a -> an).
Merge pull request #12215 from harshadsabne/master

Update 3_2_release_notes.md
Custom flash should be defined only for the class that defines it and it's subclasses.
Merge pull request #12222 from rcillo/fix-custom-flash

Custom flash should be defined only for the class that defines it and it's subclasses

Fixes #12057
Collapse where constraints to one where constraint

In order to remove duplication with joining arel where constraints with
`AND`, all constraints on `build_arel` are collapsed into one head node: `Arel::Nodes::And`

Closes: #11963
Don't require using application_name before options

Before this commit options for `rails new` and `rails plugin new` had to
be passed in a strict order, trying to execute a following command:

    rails new -J path/to/app

resulted in an error.

This commit fixes the situation and allows to pass path to app anywhere
after `new`
Fixing comment typo in ActionController::Base
Merge pull request #12223 from adomokos/fixing_typo

Fixing comment typo in ActionController::Base
Updated with latest method [ci skip]
Updated the file path [ci skip]
Updated guides with latest method [ci skip]
Removed doc of diff method [ci skip]
asset_url => asset-url in sass-rails docs [ci skip]
EncryptedCookieStore => CookieStore [ci skip]