I have build on ecommerce application in which If one person sign in and add one product in cart at that exact time other person in other machine sign in and buys the same product with exact time than there would be collision in database how to over come this...
I have created lock_version in cart. Now I want to use optimistic lock before creating the new records(order by product buyer) in database. Cart and Order are has_one relationship .
I had checked this beautiful stackoverflow Two processes saving a record in database at the same time
According to this above I had tried #59 railscasts but I failed