どうすれば救助できますか
未定義のメソッド
error in this code
for user in @users do
@customer = Stripe::Customer.retrieve(user.stripe_customer_token)
if @customer.subscription.nil?
elsif @customer.subscription.plan.id == 2
user.silver_reset
elsif @customer.subscription.plan.id == 3
user.gold_reset
end
end
私は単純なレスキューコールを試しましたが、レーキはそれを好みません。
エラーから救う方法は何ですか?
アップデート:
私のやり方
for user in @users do
@customer = Stripe::Customer.retrieve(user.stripe_customer_token)
rescue_from Exception => exception
# Logic
end
if @customer.subscription.nil?
elsif @customer.subscription.plan.id == 2
user.silver_reset
elsif @customer.subscription.plan.id == 3
user.gold_reset
end
end
エラー/home/user/rails_projects/assignitapp/lib/tasks/daily.rake:25:構文エラー、予期しないkeyword_rescue、keyword_endrescue例外を予期しています=>例外
レーキ0.9.2.2レール3.2.5