fix serialization type cast when value is already unserialized
add test for 9041454def79d8e61cabe49e7c5cb72cef29138b
just construct real objects rather than mock and stub
remove bind values for where clauses that were removed

Cherry picking following commit did not work.
https://github.com/rails/rails/commit/50823452f70341447a010df27dd514fd97bfe8a9

This commit is backport of the above commit for 4-0-stable.

fixes #10958
Merge pull request #10981 from neerajdotname/10958

remove bind values for where clauses that were removed
Fixed ActiveModel::Model's inclusion chain
Merge pull request #11004 from fredwu/4-0-activemodel-inclusion-chain-fix

Fixed ActiveModel::Model's inclusion chain
Fixes AciveModel::Model with no ancestors, fixes #11004

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
Merge pull request #11020 from fredwu/master-activemodel-inclusion-chain-fix-iii

ActiveModel::Model inclusion chain backward compatibility
Fix BacktraceCleaner#noise for multiple silencers.

The previous implementation of BacktraceSilencer#noise did not
work correctly if more than one silencer was configured --
specifically, it would only return noise which was matched by all
silencers.

The new implementation is such that anything that has been matched by
silencers is removed from the backtrace using Array#- (array
difference), ie. we now return all elements within a backtrace that
have been matched by any silencer (and are thus removed by #silence).

Fixes #11030.
Don't remove trailing slash from PATH_INFO for mounted apps

Previously when app was mounted as following:

    class Foo
      def call(env)
        [200, {}, [env['PATH_INFO']]]
      end
    end

    RackMountRailsBug::Application.routes.draw do
      mount RackTest.new => "/foo"
    end

trailing slash was removed from PATH_INFO. For example requesting

    GET /foo/bar/

on routes defined above would result in a response containing "/foo/bar"
instead of "/foo/bar/".

This commit fixes the issue.

(closes #3215)

Conflicts:
	actionpack/CHANGELOG.md
Revert "Don't remove trailing slash from PATH_INFO for mounted apps"

This should not be treated as a bug fix, because the behavior was
present in Rails for quite some time and some people may rely on it.

This reverts commit 1193a2738dc751cedcd6155076d68c9851680317.
Merge pull request #11038 from mjtko/backport/fix-11030-to-4-0-stable

(Backport #11030 to 4-0-stable) Fix BacktraceCleaner#noise for multiple silencers
Update the feedback instructions [ci skip]

Since docrails as moved from lifo/docrails to rails/docrails we have
to ask for commit rights or submit patches directly to the rails
repository
Merge pull request #11041 from robin850/4-0-stable

Backport #11033 to 4-0-stable
Merge pull request #11040 from satococoa/fix-create_join_table-document

Fix documents for create_join_table [ci skip]
Merge pull request #11050 from robin850/remove-rails-test-mention

Remove code related to the rails test command [ci skip]
Change a way ActiveRecord's config is prepared for rake tasks

In commit d1d7c86d0 I moved setting migrations paths into activerecord's
railtie to remove Rails dependency on databases.rake. However, it
introduced a regression, ENGINE_PATH was not available at the moment, so
engine's migrations where not added properly to paths. Fix was added
at 97a4a771, but it changes a way things work from using ENGINE_PATH to
APP_RAKEFILE. Additionally, the config runs when the code loads, while
previously it ran in the db:load_config rake task

In order to make it more in pair with original version this commit
changes the config to run only on load_config task. This code uses the
fact that defining a task in rake does not overwrite, but only appends.

It also allows to get back to checking for ENGINE_PATH
Setup env and seed_loaded for DatabaseTasks outside load_config

Those vars can be used in tasks, which not call load_config.
Merge pull request #10971 from dtaniwaki/escape_link_to_unless

Always escape the result of link_to_unless method