0
@report = current_account.reports.new(report_params)
@report.name.try(:strip!)
@report.report_type = "campaign"
@report.save

报告 has_and_belongs_to_many 联系人,反之亦然 当我们有大约 7000 个联系人 id 时,插入查询会变慢并且请求超时。我们不能增加超时,因为这不是解决方案。我研究过 activerecord-import 库,但我不太确定。是否有任何轨道方式可以快速插入/创建。我们不能把它放在工作中,因为它必须是实时的。

4

0 回答 0