Rails 由于在数据库表中有`model_name`,导致 ActiveRecord::Relation 以及方法全都不可用

zealinux · 2019年06月24日 · 最后由 w7938940 回复于 2019年06月24日 · 2235 次阅读
ActiveRecord::DangerousAttributeError 
  (model_name is defined by Active Record. 
    Check to make sure that you don't have an attribute or method with the same name.)

数据库表中有 model_name (不是 Rails 建的,是原有的表)

但是想用 Rails 写了项目(主要是用来迁移数据)

但是遇到这个问题有点头疼。暂时没有找到方法解决。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号