Flatten the call stacks ActiveSupport::Callbacks produces, fix #18011.
PostgreSQL, Fix change detection caused by wrong data for bytea unescaping.

This showed up when running BinaryTest#test_load_save with the more
restrictive input string handling of pg-0.18.0.pre20141117110243.gem .

Bytea values sent to the server are in binary format, but are
returned back as escaped text. To fulfill the assumption that
type_cast_from_database(type_cast_for_database(binary)) == binary
we unescape only, if the value was really received from the server.
ActiveJob testing improvements

1. The :test adapter wasn't going through a full cycle of
serialize/deserialize when performing jobs. Now it does
2. Regular AJ tests were not run for the :test adapter. Now they are
3. ActiveJob::TestHelper uses assert_valid_keys but doesn’t requires
the file that implements that method. Now it does
Merge pull request #17680 from larskanis/fix_bytea_change_detection

PostgreSQL, Fix change detection caused by superfluous bytea unescaping
Raise a better exception for renaming long indexes for mysql adapters
Share foreign_key_present? implementation in _has_ associations
Merge pull request #18219 from jaroslawr/master

Flatten the call stacks ActiveSupport::Callbacks produces, fix #18011.
Merge pull request #18242 from brainopia/has_one_loading_for_new_record

Load a has_one target for a new record if possible
use methods on the request rather than direct hash access

this will help decouple us from using the rack env hash
stop referencing `env` in url_for

encapsulate env in the request so that we can eventually move away from
the env hash
ActiveJob: delegate full deserialization to class
Merge pull request #18260 from isaacseymour/active-job-delegate-deserialize

ActiveJob: delegate deserialization to the job class
Fix error message when trying to create an associated record

This error only happens when the foreign key is missing.

Before this fix the following exception was being raised:

    NoMethodError: undefined method `val' for #<Arel::Nodes::BindParam:0x007fc64d19c218>

Now the message is:

    ActiveRecord::UnknownAttributeError: unknown attribute 'foreign_key' for Model.
Merge pull request #18266 from cristianbica/ajfixes

ActiveJob testing improvements
Merge pull request #18264 from yahonda/rename_index_mysql

Raise a better exception for renaming long indexes for mysql adapters
Extract the index length validation to a auxiliar method
Add Profiling guide skeleton [ci skip]