Ali bin Abu Talhah reported that Ibn `Abbas said that what Allah said:
وَلاَ تَجْعَلُواْ اللَّهَ عُرْضَةً لاًّيْمَـنِكُمْ
means, “Do not vow to refrain from doing good works. (If you make such vow then) break it, pay the Kaffarah and do the good work.” This was also said by Masruq, Ash-Sha`bi, Ibrahim An-Nakha`i, Mujahid, Tawus, Sa`id bin Jubayr, `Ata’, `Ikrimah, Makhul, Az-Zuhri, Al-Hasan, Qatadah, Muqatil bin Hayyan, Ar-Rabi` bin Anas, Ad-Dahhak, `Ata’ Al-Khurasani and As-Suddi.
Suporting this view, which is the majority view, is what is reported in the Two Sahihs that Abu Musa Al-Ash`ari narrated that Allah’s Messenger said:
إِنِّي وَاللهِ إِنْ شَاءَ اللهُ، لَا أَحْلِفُ عَلى يَمِينٍ فَأَرَى غَيْرَهَا خَيْرًا مِنْهَا إِلَّا أَتَيْتُ الَّذِي هُوَ خَيْرٌ وَتَحَلَّلْتُهَا
(By Allah! Allah willing, I will not vow to do a thing and then see a better act, but I would do what is better and break my vow.) Muslim reported that Abu Hurayrah said that Allah’s Messenger said:
مَنْ حَلَفَ عَلى يَمِينٍ فَرَأَى غَيْرَهَا خَيْرًا مِنْهَا فَلْيُكَفِّرْ عَنْ يَمِينِهِ، وَلْيَفْعَلِ الَّذِي هُوَ خَيْر
(Whoever makes a vow and then finds what is better than his vow (should break his vow,) pay the Kaffarah and perform the better deed.)