jjzjj

关于 ruby?? on rails:dependent: :destroy not working with validates_associated

dependent::destroynotworkingwithvalidates_associated我一直在使用uniquness嵌套属性的两个模型和表单验证。保存表单时,唯一性验证的范围是列表用户的电子邮件地址。我遇到了一个错误,如果用户尝试在一个事务中保存两封电子邮件,则不会触发验证,因为它会检查数据库中的现有记录,而不是内存中即将保存的对象。我的模型如下:123456789101112131415161718classListActiveRecord::Base has_many:competitors,dependent::destroy,inverse_of::list acce

关于 ruby?? on rails:dependent: :destroy not working with validates_associated

dependent::destroynotworkingwithvalidates_associated我一直在使用uniquness嵌套属性的两个模型和表单验证。保存表单时,唯一性验证的范围是列表用户的电子邮件地址。我遇到了一个错误,如果用户尝试在一个事务中保存两封电子邮件,则不会触发验证,因为它会检查数据库中的现有记录,而不是内存中即将保存的对象。我的模型如下:123456789101112131415161718classListActiveRecord::Base has_many:competitors,dependent::destroy,inverse_of::list acce