Or are you referencing another bible passage that states what you are saying?
The relevant passage is about how a woman taking a vow of celibacy will have that vow ratified by either her father, or her husband.
Num 30:3 "If a woman vows a vow to the LORD and binds herself by a pledge, while within her father’s house in her youth,
Num 30:4 and her father hears of her vow and of her pledge by which she has bound herself and says nothing to her, then all her vows shall stand, and every pledge by which she has bound herself shall stand.
Num 30:5 But if her father opposes her on the day that he hears of it, no vow of hers, no pledge by which she has bound herself shall stand. And the LORD will forgive her, because her father opposed her.
Num 30:6 “If she marries a husband, while under her vows or any thoughtless utterance of her lips by which she has bound herself,
Num 30:7 and her husband hears of it and says nothing to her on the day that he hears, then her vows shall stand, and her pledges by which she has bound herself shall stand.
Num 30:8 But if, on the day that her husband comes to hear of it, he opposes her, then he makes void her vow that was on her, and the thoughtless utterance of her lips by which she bound herself. And the LORD will forgive her.
Num 30:9 (But any vow of a widow or of a divorced woman, anything by which she has bound herself, shall stand against her.)
Num 30:10 And if she vowed in her husband’s house or bound herself by a pledge with an oath,
Num 30:11 and her husband heard of it and said nothing to her and did not oppose her, then all her vows shall stand, and every pledge by which she bound herself shall stand.
Num 30:12 But if her husband makes them null and void on the day that he hears them, then whatever proceeds out of her lips concerning her vows or concerning her pledge of herself shall not stand. Her husband has made them void, and the LORD will forgive her.
Num 30:13 Any vow and any binding oath to afflict herself, her husband may establish, or her husband may make void.
Num 30:14 But if her husband says nothing to her from day to day, then he establishes all her vows or all her pledges that are upon her. He has established them, because he said nothing to her on the day that he heard of them.
Num 30:15 But if he makes them null and void after he has heard of them, then he shall bear her iniquity.”
Num 30:16 These are the statutes that the LORD commanded Moses about a man and his wife and about a father and his daughter while she is in her youth within her father’s house.
Mary took a vow of celibacy before she was given to Joseph. Girls who were dedicated to God were permitted to remain at the Temple until puberty, but at that time, they were placed in the custody of an upright man in the community to be their guardian. Often such temple virgins were given to older men who had already completed their families, and could afford to support and protect such a young virgin.
A man entered into this relationship (marriage) fully consenting that he would honor the vow of celibacy of the woman. If the young lady made the vow “rashly” then the husband or father could nullify it.