rails/rails — pull request #16367 by k0kubun (2014-08-01 15:27:41+00:00)
Title: Unscope preload and includes in unscoped block

This PR fixes https://github.com/rails/rails/issues/11036.

Currently unscoped block does not work for `includes` and `preload`.
I changed `ActiveRecord::Associations::Preloader` to use [all](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/scoping/named.rb#L24-L30) instead of [default_scoped](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/scoping/named.rb#L32-L34).

If a class is unscoped, the class's current_scope is changed to not default_scoped one and used by `all`.