Add option to class_attribute for skipping the predicate method

Fixes #10107.