Merge pull request #12565 from stormsilver/unscope_fixes

Allow unscope to work with `where.not`
Conflicts:
	activerecord/CHANGELOG.md