When the verse "And upon those who are able to fast, a ransom of feeding a poor person" [Baqarah 2:184] was revealed, anyone among us who wished could break his fast and pay the ransom, until the verse that came after it was revealed and abrogated it.
أخبرنا قتيبة قال أنبأنا بكر وهو ابن مضر عن عمرو بن الحارث عن بكير عن يزيد مولى سلمة بن الأكوع
لما نزلت هذه الآية {وعلى الذين يطيقونه فدية طعام مسكين} كان من أراد منا أن يفطر ويفتدي حتى نزلت الآية التي بعدها فنسختها
Bukhari transmitted it in the Tafsir, chapter "Whoever among you witnesses the month, let him fast it," hadith 4507, and Muslim, the Fasting, chapter explaining the abrogation of Allah's saying, "And upon those who are able to do it is a fidya," etc., hadith 1145, from Qutayba, with the same chain, and it is in Kubra, hadith 2625.