Merge pull request #11566 from rajcybage/master

add the missing middleware in command line guides rake about [ci skip]
Conflicts:
	guides/source/command_line.md
Use GeneratedAttribute#column_name if #reference? scaffold_generator in _form view [Fixes #11573]
Merge pull request #11570 from joelcogen/harmonize_text_field_and_area

text_area should handle nil value option like text_field
Conflicts:
	actionview/CHANGELOG.md
Specified column type for quote_value

When calling quote_value the underlying connection sometimes requires
more information about the column to properly return the correct quoted
value.

I ran into this issue when using optimistic locking in JRuby and the
activerecord-jdbcmssql-adapter. In SQLSever 2000, we aren't allowed to
insert a integer into a NVARCHAR column type so we need to format it as
N'3' if we want to insert into the NVARCHAR type. Unfortuantely, without
the column type being passed the connection adapter cannot properly return
the correct quote value because it doesn't know to return N'3' or '3'.

This patch is fairly straight forward where it just passes in the column
type into the quote_value, as it already has the ability to take in the column,
so it can properly handle at the connection level.

I've added the tests required to make sure that the quote_value method
is being passed the column type so that the underlying connection can
determine how to quote the value.

Conflicts:
	activerecord/CHANGELOG.md
Tidy up the "Specified column type for quote_value" changes

This includes fixing typos in changelog, removing a deprecated
mocha/setup test require, and preferring the `column_for_attribute`
accessor over direct access to the columns_hash in the new code.

Conflicts:
	activerecord/CHANGELOG.md
don't convert mailer default values to procs

Invoke mailer defaults as procs only if they are procs, do not convert
with to_proc.  That an object is convertible to a proc does not mean it's
meant to be always used as a proc.  Fixes #11533

Conflicts:
	actionmailer/CHANGELOG.md
Merge pull request #11581 from bughit/11533_to_proc_backport

don't convert mailer default values to procs
New CHANGELOG entries are always on top

[ci skip]
Allow overriding of all headers from passed environment hash

Allow REMOTE_ADDR, HTTP_HOST and HTTP_USER_AGENT to be overridden from
the environment passed into `ActionDispatch::TestRequest.new`.

Fixes #11590

(cherry picked from commit 4db0637d556ab11c55de6afcaa267147a032a74d)

Conflicts:
	actionpack/CHANGELOG.md
Merge pull request #11591 from ankit8898/typo

Typo fix [ci skip]
rake -> bin/rake
Don't mutate the Base settings by merge!ing the given value
Merge pull request #11620 from spajus/update_docs

Update Rails 3.2.x guide link [ci skip]
Merge pull request #11653 from ankit8898/typo

Fixing the broken URL [skip ci]
Revert change on ActiveRecord::Relation#order method that prepends new
order on the old ones

The previous behavior added a major backward incompatibility since it
impossible to have a upgrade path without major changes on the
application code.

We are taking the most conservative path to be consistent with the idea
of having a smoother upgrade on Rails 4.

We are reverting the behavior for what was in Rails 3.x and,
if needed, we will implement a new API to prepend the order clauses in
Rails 4.1.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/query_methods.rb
	guides/source/upgrading_ruby_on_rails.md
Merge pull request #11664 from thedarkone/digestor-thread-safety

AV::Digestor thread safety fixes
Fix `current_page?` when the URL contains escaped characters

In some cases webservers like nginx send the escaped characters
lowercased to the Rails application. The current_page? helper was
comparing the escaped strings that are different since Ruby escapes the
URL using uppercased characters.

Conflicts:
	actionview/CHANGELOG.md
Make current_page? compare binary strings
Use the right minitest method
Backport changelog fixed from #11713 [ci skip]