ruby中,使用activerecord生产的数据访问类,结果出现如标题的错误
“This error is raised because the column 'type' is reserved for storing the class in case of inheritance”

google了下,原来是表中有type这个字段,而type应该是被ruby或者是activerecord作为一个保留字之类的,所以出现这个错误

需要的做法是,给改个别名来访问

 

 s
 end
end

 

这样基本可以搞定

相关文章:

  • 2021-09-13
  • 2022-12-23
  • 2021-05-29
  • 2021-10-02
  • 2022-12-23
  • 2021-08-25
  • 2021-05-26
  • 2021-10-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2021-05-17
  • 2022-02-19
  • 2021-04-29
相关资源
相似解决方案