Raise an error for has_one associations which try to go :through a polymorphic association

This PR addresses the missing exception dedicated to `has_one` associations which try to go :through a polymorphic association.

Issue raised by @georgemillo in #17263.
I actually didn't look through commits to see how others are using the new syntax. After a quick look, it seems (to me) like it's [only for new classes](https://github.com/rails/rails/pull/17232/files)?

Personally I'm still a bit leaning towards having `activerecord/test/models/member.rb`'s consistency kept. However, if the team asks for the revision, I'm happy to follow.

@eileencodes: thanks for taking a look at my PR.