I\xe2\x80\x99m 使用 Rails 6.1.4.4。我这个模型有一个 has_many
\nclass MyObject < ApplicationRecord\n\n has_many :products, inverse_of: :application, as: :item\nRun Code Online (Sandbox Code Playgroud)\n如何编写执行左外连接并在 LEFT-OUTER-JOIN-ON 子句中添加条件的作用域?我已经求助于原始sql \xe2\x80\xa6
\nscope :awaiting_funding, ->(resubmissions: false) {\n\n joins("LEFT OUTER JOIN products on products.item_id = my_objects.id and products.product_type = 11 and products.item_type = \xe2\x80\x98MyObject\xe2\x80\x99\xe2\x80\x9d).where('products.id is null')\n\n}\nRun Code Online (Sandbox Code Playgroud)\n但我想将其转换为更像 Rails 的查找器方法。
\n