我在自动保存以这种方式创建的对象时遇到了问题。search_term_occurrences, dependent: :destroy belongs_toRecordInvalid: Validation failed: Search term occurrences is invalid, Search term occurrences is invalid
但是当我省略belongs_tosearch
我有以下两种型号: class Offer < ApplicationRecordend
belongs_to:offer
end 当我尝试在没有offer_id的情况下保存Booking对象时,Rails抛出一个验证错误"Offer is required“。但是我不会主动验证关联对象的存在(我打算稍后为这个<e