def before_create_save(record)
vouchercode = generate_vouchercode(8)
while Voucher.find(:first, :conditions => {:vouchercode => vouchercode})
...
def before_create_save(record)
vouchercode = generate_vouchercode(8)
while Voucher.find(:first, :conditions => {:vouchercode => vouchercode})
...
Coming from python, I would...