What if your sms service failed? You render 'new' action as if nothing has happened, meanwhile Lead is persisted in the database and in the remote system, right? Then user sends form once again, and you have one more Lead in the db and in remote system. Am I missing something?
Ruby on Rails developer - Maker of ✨ things on the Internet. O(🐌^n) kind of guy. Alumni @lewagonparis (batch 145). Builds wooden furniture on his balcony.
In the transaction has it's written above, yes. This is what would happen.
I'd include a first step that checks if the new lead already exists in the DB and branch out if that's the case. This really depends on your business logic. :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What if your sms service failed? You render 'new' action as if nothing has happened, meanwhile Lead is persisted in the database and in the remote system, right? Then user sends form once again, and you have one more Lead in the db and in remote system. Am I missing something?
In the transaction has it's written above, yes. This is what would happen.
I'd include a first step that checks if the new lead already exists in the DB and branch out if that's the case. This really depends on your business logic. :)