Unique number generation for ActiveRecord / Rails