rails - oracle的table primary id 一定要指定,否则会出现TypeError: nil is not a symbol nor a string
访问量: 1629
一个项目, 数据库使用了 oracle,
table 主键 是 cid , 不是 id ,
所以在 做 update操作的时候, 出现了错误提示: TypeError: nil is not a symbol nor a string
不google的话,完全没有头绪. (我的关键词应该是这个 , 加上rails)
所以,一定要指定 primary_id啊.
class YourDependentRecord < ApplicationRecord self.primary_key = 'user_id' end