My Rails app needs to generate electronic coupons for users. Each coupon given should have a unique coupon code that can be redeemed on our system.
For example a cou
You can e.g. use a random number and check if it was not generated before, by storing all valid codes in a database.