fix exception on polymorphic associations with predicates