[LRUG] Enforcing uniqueness

Jocke Selin jocke at selincite.com
Mon Nov 14 04:31:58 PST 2011


On Mon, Nov 14, 2011 at 12:00 PM, Andrew Stewart
<boss at airbladesoftware.com> wrote:
> In fact that last idea reminded me that I need to give book a state (as in state machine): as well as being available or on loan, a book can also be lost or donated.
>
> Now if book has a state column, I think I can use Rails' pessimistic locking[1] (select ... for update) to manage the state change like this:
>
> Does that sound sensible?

Yes it does, very good. How are you planning on implementing the state?

Cheers,

/Jocke



More information about the Chat mailing list