class Rdr1< ActiveRecord::Base set_table_name :rdr1 belongs_to :ordr,:foreign_key => "DocEntry" belongs_to :oitm 其中 belongs_to :ordr,:class_name=> "ordrs",:foreign_key => "DocEntry"
这个语句影响了主从表写入,应该改成 rdr1s
class Rdr1< ActiveRecord::Base set_table_name :rdr1 belongs_to :ordr,:foreign_key => "DocEntry" belongs_to :oitm 其中 belongs_to :ordr,:class_name=> "ordrs",:foreign_key => "DocEntry"
这个语句影响了主从表写入,应该改成 rdr1s