It is from here: http://www.suttas.com/chapter-8-naga-sa ... nagas.htmlSN 29.3 Uposatha Sutta: The Uposatha (1)
At Savatthi. Then a certain bhikkhu approached the Blessed One, paid homage to him, sat down to one side, and said to him: "Venerable sir, what is the cause and reason why some egg-born nagas here observe the Uposatha and relinquish [concern for] their bodies?"
"Here, bhikkhus, some egg-born nagas think thus: 'In the past we acted ambivalently in body, speech, and mind. Having done so, with the breakup of the body, after death, we were reborn in the company of egg-born nagas. If today we praise good conduct of body, speech, and mind, then with the breakup of the body, after death, we shall be reborn in a happy destination, in a heavenly world. Come now, let us practice good conduct of body, speech, and mind.' "
"This, bhikkhu, is the cause and reason why some egg-born nagas here observe the Uposatha and relinquish [concern for] their bodies."
(Egg born dragons sometimes transform their bodies and observe the sabbath in order to get a good rebirth.)
The material in (round brackets) is editorial, I believe. It combines this story with the story of a Naga being caught as a monk when he reverted to his serpentine form asleep. The editorial material might be from the commentaries, I would not know if that were the case.
This implies that the Nagas have a samgha and observe the uposatha and probably practice the Dhammavinaya. How does this square with Nagas being banned from the (human) samgha? If Nagas have their own samgha, do the gods have samghas similarly? They say the Buddha taught the Abhidharma in heaven to the Tuṣita gods. It would make sense if the Buddha taught his Dharma to a retinue of disciples. Or is there no heavenly (and also Nagic) samgha in Theravada Buddhism? I recall the story of a man who despaired because he would be reborn as a particular kind of deva and would be unable to hear the Buddha preach in his lifetime. This entire thread is also to-do with the notion of a "precious human birth."