Merge pull request #12065 from SamSaffron/result_optimisation

Perf: micro optimised Result column hash_row creation
Merge pull request #12194 from thedarkone/readonly-merger-fix

Relation#merge should not lose readonly(false) flag.
Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #12185 from SamSaffron/join_dep

Reduce allocations when extracting AR models
Merge pull request #12135 from dylanahsmith/avoid_empty_transaction

Avoid empty transaction from setting has_one association on new record.

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
Merge branch '4-0-stable' of github.com:rails/rails into 4-0-stable

* '4-0-stable' of github.com:rails/rails:
  Merge pull request #12135 from dylanahsmith/avoid_empty_transaction
  Merge pull request #12185 from SamSaffron/join_dep
  Merge pull request #12194 from thedarkone/readonly-merger-fix
  Merge pull request #12148 from gzohari/callback-typo
  Merge pull request #12143 from rajcybage/fixing_typos
  Merge pull request #12139 from vipulnsward/typos_av
  Merge pull request #12130 from egilburg/patch-1
Merge pull request #12188 from SamSaffron/master

Perf: avoid dupes add fallback logic for coders
Check if the SQL is not a prepared statement

When the adapter is with prepared statement disabled and the binds array
is not empty the connection adapter will try to set the binds values and
will fail. Now we are checking if the adapter has the prepared statement
disabled.

Fixes #12023

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
	activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
Remove invalid comment

This is not valid anymore after 08477a651648ba4417ded128aa37b9ae0dcbc9ce
Fix inverted conditional

Oops, I should had run the tests
Merge pull request #12205 from claudiob/remove-unused-raw-email-fixtures

Remove unused raw email fixtures
Fix typo on instance variable get call
Disable prepared statements in the unprepared_statement block
Add CHANGELOG entry for #11065

[ci skip]
Add CHANGELOG entry for #11069

[ci skip]
Add CHANGELOG entry for #11440

[ci skip]
Add CHANGELOG entry for #11161

[ci skip]
Add CHANGELOG entry for de20a6d15ac98464b87e8be9a493050b741e2fd2

[ci skip]
Merge pull request #12206 from harshadsabne/master

Update 4_0_release_notes.md
Conflicts:
	guides/source/4_0_release_notes.md
Merge pull request #11603 from jetthoughts/join_strings_instead_of_contactination

Cleanup: replace String concatenation by joining for excerpt helper

Conflicts:
	actionview/CHANGELOG.md
Add CHANGELOG entry for #11603

[ci skip]