【发布时间】:2016-11-09 08:43:01
【问题描述】:
我正在制作一个应用程序,该应用程序将根据您使用 ShopifyAPI::Customer 的 order_count 更新运费。
我想要完成的一个主要事情是能够将所有客户的 order_count 重置为零。
我一直在尝试:
order = ShopifyAPI::Customer.all
order.update_all(:orders_count, "0")
当我针对单个客户而不是 Customer.all 时,它可以工作。有没有办法解决这个问题,一次更新数据库中的所有客户?
【问题讨论】:
标签: ruby-on-rails ruby shopify