check class hierarchy with is_a? in PredicateBuilder.expand

add changelog entry for #11945