diff --git a/lib/tasks/promotion_code.rake b/lib/tasks/promotion_code.rake index 13631c2..170d2eb 100644 --- a/lib/tasks/promotion_code.rake +++ b/lib/tasks/promotion_code.rake @@ -1,9 +1,11 @@ +# frozen_string_literal: true + namespace :promotion_code do task generate: :environment do - 10.times do |n| + 10.times do code = SecureRandom.alphanumeric(7) discount = rand(1..10) * 100 - PromotionCode.create(code: ,discount:) + PromotionCode.create(code:, discount:) puts "コード #{code} で#{discount}円割引" end end