prevent bad automatic inverse_of association

This should fix #15337.  The problem is that the automatic inverse_of code ignores the "as" code and can accidentally reflect on the wrong assocation and fail to determine the the association is polymorphic.  If the model with a polymorphic belongs_to association also has a non-polymorphic assocation to the same class it will reflect on that association.