During Ramadan in the time of the Messenger of Allah ﷺ, whoever wished would fast and whoever wished would break the fast and compensate by feeding a poor person, until this verse was revealed, "So whoever among you witnesses the month, let him fast it" [Baqarah 2:185].
حدثني عمرو بن سواد العامري أخبرنا عبد الله بن وهب أخبرنا عمرو بن الحارث عن بكير بن الأشج عن يزيد مولى سلمة بن الأكوع
كنا في رمضان على عهد رسول الله ﷺ من شاء صام ومن شاء أفطر فافتدى بطعام مسكين حتى أنزلت هذه الآية {فمن شهد منكم الشهر فليصمه}