Ubayd bin Rifa'ah (may Allah have mercy on him) narrates from his father; he said: "We used to do this in the time of the Messenger of Allah (peace and blessings be upon him); when we did not ejaculate, we would not perform ghusl."
Hadith Referenceالمعجم الكبير للطبراني / باب الراء / 4522