Google's Ngram Viewer seems to trace the phrase to the 1850s, though others have turned up earlier references:
https://books.google.com/ngrams/graph?content=when+it+rains+...
And dialing in more on the period 1800 -- 1950:
Note that OCR and other errors may produce spurious hits or date references, though the record here seems pretty clear.
Google's Ngram Viewer seems to trace the phrase to the 1850s, though others have turned up earlier references:
https://books.google.com/ngrams/graph?content=when+it+rains+...
And dialing in more on the period 1800 -- 1950:
https://books.google.com/ngrams/graph?content=when+it+rains+...
Note that OCR and other errors may produce spurious hits or date references, though the record here seems pretty clear.