Check before calling klass.primary_key