[Machine] The companions of Muhammad ﷺ narrated that fasting was initially prescribed in three different situations: when people first arrived in Madinah and were not accustomed to fasting, they would fast for three days each month. This continued until the month of Ramadan was revealed, at which point they increased their fasting and found it difficult. Whoever fed a poor person every day instead of fasting was allowed to do so, if they were not capable of fasting. This ruling was then abrogated when the verse "And fasting is better for you, if only you knew" (2:184) was revealed, and they were commanded to fast. Al-Bukhari and Ibn Numair both mentioned the same in a summarized form.
ثنا أَصْحَابُ مُحَمَّدٍ ﷺ قَالُوا أُحِيلَ الصَّوْمُ عَلَى ثَلَاثَةِ أَحْوَالٍ قَدِمَ النَّاسُ الْمَدِينَةَ وَلَا عَهْدَ لَهُمْ بِالصِّيَامِ فَكَانُوا يَصُومُونَ ثَلَاثَةَ أَيَّامٍ مِنْ كُلِّ شَهْرٍ حَتَّى نَزَلَ شَهْرُ رَمَضَانَ فَاسْتَكْثَرُوا ذَلِكَ وَشَقَّ عَلَيْهِمْ فَكَانَ مَنْ أَطْعَمَ مِسْكِينًا كُلَّ يَوْمٍ تَرَكَ الصِّيَامَ مِمَنْ يُطِيقُهُ رَخَّصَ لَهُمْ فِي ذَلِكَ وَنَسَخَهُ {وَأَنْ تَصُومُوا خَيْرٌ لَكُمْ إِنْ كُنْتُمْ تَعْلَمُونَ} [البقرة 184] قَالَ فَأُمِرُوا بِالصِّيَامِ قَالَ الْبُخَارِيُّ وَقَالَ ابْنُ نُمَيْرٍ حَدَّثَنَا الْأَعْمَشُ فَذَكَرَ بَعْضَ مَعْنَاهُ مُخْتَصَرًا