我没有config.active_record.whitelist_attributes = true应用程序配置。我attr_protected()在模型课上。但是,我注意到idandtype属性会自动插入到ActiveModel::MassAssignmentSecurity::BlackList. 这对属性是有意义的,id因为我们不想id在批量分配中进行设置,但为什么属性也是如此type?
2674 次
我没有config.active_record.whitelist_attributes = true应用程序配置。我attr_protected()在模型课上。但是,我注意到idandtype属性会自动插入到ActiveModel::MassAssignmentSecurity::BlackList. 这对属性是有意义的,id因为我们不想id在批量分配中进行设置,但为什么属性也是如此type?