Do ActiveRecord locks only work when they are inside of a transaction? If I open up two rails consoles and find a record then call lock! on that record I can still access the record from the other console.
According to the docs, lock! does not include a transaction. with_lock does, though, and should prevents you from writing to (but not reading from) the locked record.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With