For those situations where you want multiple threads doing database stuff in your Ruby app (but not in Rails - threading Rails doesn’t make much sense), turn ActiveRecord’s concurrency support on:

ActiveRecord::Base.allow_concurrency = true

Found on this useful blog.