Court rules on capacity to consent in sexual relations