When the verse "And upon those who are able to fast, a ransom of feeding a poor person" [Baqarah 2:184] was revealed, whoever among us wished to break the fast could do so and pay the ransom, until the verse after it was revealed and abrogated it.
حدثنا قتيبة حدثنا بكر بن مضر عن عمرو بن الحارث عن بكير بن عبد الله بن الأشج عن يزيد مولى سلمة بن الأكوع
لما نزلت {وعلى الذين يطيقونه فدية طعام مسكين} كان من أراد منا أن يفطر ويفتدي حتى نزلت الآية التي بعدها فنسختها
Agreed upon (by Bukhari and Muslim). Bukhari narrated it in the tafsir of Surah Baqarah, the chapter titled "Whoever among you witnesses the month, let him fast it," hadith 4507, and Muslim narrated it in the Book of Fasting, the chapter titled "Explanation of the abrogation of the statement of Allah Most High, 'And upon those who are able to do it is a fidya, feeding a poor person...' etc.," hadith 1145, both from Qutayba with the same chain.