Rabbi Simon said: We find that the Holy One blessed be He performs kindness for the descendants due to the merit of their progenitor.16This is a common theme throughout the Bible. From where is it derived that the Holy One blessed be He performs [kindness] with the progenitor due to the merit of his descendants? “But Noah found favor in the eyes of the Lord” – by what merit? It is due to the merit of his descendants.17As the next verse states, "These are the offspring of Noah.” It was in the merit of his future generations that Noah was saved.
Saga of Noah
Bereshit Rabbah 29:5