Rails:如何保护属性(不调用attr_protected或attr_accessible)?

| 我收到\“警告:无法批量分配受保护的属性:type \”,但是我的代码中没有任何对
attr_accessible
attr_protected
的调用。 还有其他可能导致属性受到保护的情况吗? 我不太想将所有属性添加到“ 0”语句中,因为这仅是需要维护的一件事。     
已邀请:
        
type
属性保留供内部使用,以用于单表继承。 通过设置
set_inheritance_column
,您应该能够使用
type
set_inheritance_column :kind # change to something other than :type.
    
        签出:Rails attr_accessible不适用于:type吗?
:type
是您的问题。     

要回复问题请先登录注册