Pass a base relation to build_default_scope when joining

This allows the default scope to be built using the current table alias.
Resolves #12770
ActiveRecord/ActiveModel '#validate' alias for 'valid?'

It's unintuitive to call '#valid?' when you want to run validations but
don't care about the return value.

The alias in ActiveRecord isn't strictly necessary (the ActiveModel
alias is still in effect), but it clarifies.
Merge pull request #14456 from henrik/add-validate-method

ActiveRecord/ActiveModel '#validate' alias for 'valid?'
Add CHANGELOG to Active Model too [ci skip]
AR .persisted? throws SystemStackError for an unsaved model with a
custom primary_key that didn't save due to validation error
Merge pull request #14393 from chrisfinne/persisted_exception

AR .persisted? throws SystemStackError for an unsaved model with a
custom primary_key that didn't save due to validation error
Adds explanation of :base attribute to errors.add

[ci skip]
Merge pull request #14505 from davefp/patch-1

Adds explanation of :base attribute to errors.add [ci skip]
Merge pull request #14469 from tiegz/timestamp_inheritance_fix

Swap Timestamp/Callbacks order in ActiveRecord::Base
Merge pull request #14154 from al2o3cr/issue12770

Pass a base relation to build_default_scope when joining
PostgreSQL, test cases to lock the current column types.
Merge branch 'master' of https://github.com/rails/rails