Merge pull request #12889 from kuldeepaggarwal/speed_ups

Used Yield instead of block.call
avoiding next statements
Merge pull request #12892 from akshay-vishnoi/refactor

avoiding next statements
Addendum to #12891
* Fix incorrectly named tests
* Restore Object#to_param behavior
* Ensure param is derived from a squished and truncated string
Merge pull request #12819 from vipulnsward/also_dup_column_types

Also dup `column_types` in AR::Result `initialize_copy`
Merge pull request #12893 from javan/to-param-addendum

Addendum to #12891
Fix that eager loading of polymorphic associations did not work with association empty?/any? predicates any more (there is still a problem when select is applied to a relation, or if you try association#exists? -- but its easier to work around)
Revert "Used Yield instead of block.call" -- this causes all of atom_feed_helper_test.rb to fail with "SystemStackError: stack level too deep".

This reverts commit d3a1ce1cdc60d593de1682c5f4e3230c8db9a0fd.
Improved compatibility with the stdlib JSON gem.

Previously, calling `::JSON.{generate,dump}` sometimes causes
unexpected failures such as intridea/multi_json#86.

`::JSON.{generate,dump}` now bypasses the ActiveSupport JSON encoder
completely and yields the same result with or without ActiveSupport.
This means that it will **not** call `as_json` and will ignore any
options that the JSON gem does not natively understand. To invoke
ActiveSupport's JSON encoder instead, use `obj.to_json(options)` or
`ActiveSupport::JSON.encode(obj, options)`.
Merge pull request #12862 from chancancode/json_gem_compat

JSON gem compatibility
Set branch for arel in Gemfile so that we can use bundle local config [ci skip]
Fix AR Changelog examples and improve syntax highlight [ci skip]
Fix test name [ci skip]
Avoid creation of extra hash with merge just to set a value
Simplify number parsing logic in numericality validation
Use a simple conditional rather than short circuit with next
Avoid a new hash allocation
Make code simpler to read by using a case statement
Cache regexp source on format validation to avoid allocating new objects

Example:

    >> r = /some-regexp/
    => /some-regexp/
    >> r.source.object_id == r.source.object_id
    => false
Remove argument that is accessible as attribute