Other code in the Predicate builder allows nil to be one of the elements in an array value. Following that behavior, we should get rid of nil as the possible first value for determining the base_class of the value. It's not absolutely perfect but it's way better than the previous behavior.

I also had a version of this code locally where I mapped the value to all base_classes and then the generated query would do polymorphic_type IN ("TypeA","TypeB") if there were more than one type in the Array. We could do that also if you think it's better. It just seemed like overkill.