【发布时间】:2021-08-06 11:40:18
【问题描述】:
在我的网站上,用户可以通过 simple_form_for 上传文档(感谢 Cloudinary gem):
<%= f.cl_image_upload(:ids, allowed_formats: %w(jpg jpeg png)) %>
这些文档通过 API 发送到 Stripe。 所以在我的用户模型中,我放了:
after_update send_documents_to_stripe, if: :documents_are_upload?
(它只是检查用户是否上传了他的文档,如果是,则调用将文档发送到 Stripe 的函数)
除了after_update 等待文档进入数据库但不等待文档在 Cloudinary 上可用。
所以当我尝试将文档发送到 Stripe 时,我收到了这个错误:
有谁知道我在技术上可以等待以确保 Cloudinary 已收到用户的图像,然后再将文档发送到 Stripe?
非常感谢!
【问题讨论】: