On Sat, Aug 5, 2017 at 10:23 AM, siva subrahmanyam
<subbu9848155...@gmail.com> wrote:

> Sorry for the confusion. Currently, I solved (just avoided concurrency)
> issue by adding a status column to slot model. So when a user trying to
> purchase that slot I update status column to hold so that other user don't
> able to book same slot at the same time.

Seems fine. Though didn't you need a field before to hold the
booked/not-booked status of the slot? which could be "pending"
as well?

> Now I want solve the same problem without adding DB column.

Why? If the "status" is an attribute of the model, why would you
*not* keep it in the DB?

It has to be persisted somewhere, and sure, you *could* use a
key-value store like Redis but what is the point? Seems like an
unnecessary complexity.

-- 
Hassan Schroeder ------------------------ hassan.schroe...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBU2N35xibQ%2BqTA9Wmkz__jAg%2BSBisnpe-o23hs_LmE%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to