On the wagon or off the wagon?

on or off the wagon?

I asked someone the other day if they were still on the wagon (She was cutting smoking out). But then realized that everyone has a different way of looking at it and that my own view is muddled. I know it originates with drinking (I should say I think) but also applies to other assorted misbehaviors.
When are you on the wagon?, when you are drinking, or are not. And what is the origin of the phrase?

“On the wagon” means that you are not drinking. I always assumed that it had historical roots in the Temperance Movement. Maybe they rode reformed drunks around town on a wagon to advertise their cause?

“On the wagon” comes from “on the water wagon”,a term to indicate that you’ve given up “John Barleycorn” for more temperate ways.