During the days of pre-Islamic ignorance, a man would worship a white stone for a period of time. Then, if he came across a stone more beautiful than it, he would discard the first and worship the new one. So Allah revealed the verse.
في قوله تعالى: {أريت من اتخذ إلهه هواه}
كان الرجل يعبد الحجر الأبيض زمانا من الدهر في الجاهلية، فإذا وجد حجرا أحسن منه رمى به، وعبد الآخر، فأنزل الله الآية.
No references are available.
Ibn Abu Hatim narrated it in his Tafsir (8/2699-2700), and Maqdisi in Al-Ahadith Al-Mukhtarah (10/120-121), both of them through the route of Yaqub bin Abdullah Qummi, from Jafar bin Abu Mughira, from Saeed bin Jubayr, from Ibn Abbas, who said, then he mentioned it. Its chain of transmission is hasan on account of Yaqub bin Abdullah Qummi and his teacher Jafar bin Abu Mughira, for both of them are hasan in hadith.