It was narrated from Anas bin Malik that:When the Prophet entered the toilet, he would take off his ring.
حَدَّثَنَا نَصْرُ بْنُ عَلِيٍّ الْجَهْضَمِيُّ، حَدَّثَنَا أَبُو بَكْرٍ الْحَنَفِيُّ، حَدَّثَنَا هَمَّامُ بْنُ يَحْيَى، عَنِ ابْنِ جُرَيْجٍ، عَنِ الزُّهْرِيِّ، عَنْ أَنَسِ بْنِ مَالِكٍ، أَنَّ النَّبِيَّ ـ صلى الله عليه وسلم ـ كَانَ إِذَا دَخَلَ الْخَلاَءَ وَضَعَ خَاتَمَهُ .
IbnMaja
The Book of Purification and its Sunnah • Hadith 303