A purchaser shall not, under this article, or articles one, two and eleven, chapter thirty-eight of this code, be affected by the record of a deed or contract made by a person under whom his title is not derived; nor by the record of a deed or contract made by any person under whom the title of such purchaser is derived, if it was made by such person, and was recorded, before he acquired the legal title.