Add table-level database locking to ActiveRecord