Fix how to compute class name on habtm namespaced.

Thank's for @laurocaetano for the help with tests. :smiley:

Fixes #14709
Merge pull request #14871 from kassio/kb-fixes-namespaced-habtm

Fix how to compute class name on habtm namespaced.

Conflicts:
	activerecord/CHANGELOG.md
Don't use Active Support where it is not needed.

parent_name is a string of nil, never a blank string so we don't need to
use presence.