Hi everyone,
I have a order with order_lines use case. On changing the lines, I
want to be sure no one else changed the order. So I use lock_version
on the order. This works fine if something is changed on the order
record.
But now i have the situation that I delete, alter and add order lines
without changing the order record itself. I have to check and
increment the order#lock_version however in advance. If I do this:
@order.update_attributes!( {:lock_version=> params[:order]
[:lock_version]} )
nothing gets changed nor with:
@order.update_attributes!( params[:order] )
as the attributes itself haven’t changed. I could solve it with a
dummy column that I could change to current time or so but that’s just
not a clear solution.
Any suggestions?
Thanks
Jan