Skip to content

Instantly share code, notes, and snippets.

@semind
semind / note_for_locking
Created June 23, 2012 09:15 — forked from zflat/note_for_locking
rails with_lock
see http://guides.rubyonrails.org/3_2_release_notes.html
This makes it possible to write the following:
class Order < ActiveRecord::Base
def cancel!
transaction do
lock!
# ... cancelling logic