Scoped, thread safe sequences for ActiveRecord models