Gay rights campaigners hail ruling