I have a model that allows user A to propose a time for an appointment to user B. If B accepts, then event is set. But if B proposes another time, then A must accept or propose another time, and so on. Until one user accept the other’s counter-proposal, the appointment won’t be set.
How should I model this kind of back and forth proposals and to keep track of current stage in Rails?
Thank you.
What you’re describing is a state machine.
Older SO question discussing the various gems and plugins of the time, plus some basics.
Newer blog post discussing the hows and whys.