Zubayr bin Adi (may Allah have mercy on him) narrates from Ibrahim (may Allah have mercy on him) that when the fetus's mother is slaughtered, the fetus also takes the ruling of its mother.