Merge pull request #13061 from laurocaetano/fix-uniqueness-validation-for-aliased-attribute

Fix bug when validating the uniqueness of an aliased attribute.
Conflicts:
	activerecord/CHANGELOG.md