弃用警告关于质量分配导轨4.0

时间:2016-11-11 13:50:17

标签: ruby-on-rails ruby ruby-on-rails-4

我正在将应用升级到4.0并使用ruby-2.2.5。我有几个弃用警告,当我运行>>时出现捆绑执行耙。

其中一个警告:

DEPRECATION WARNING: Model based mass assignment security has been extracted out of Rails into a gem. 
Please use the new recommended protection model for params or add `protected_attributes` to your Gemfile to use the old one.

To disable this message remove the `whitelist_attributes` option from your `config/application.rb` file 
and any `mass_assignment_sanitizer` options from your `config/environments/*.rb` files.

See http://guides.rubyonrails.org/security.html#mass-assignment for more information.

我明白了这一点,并且我已经完成了所有寻找和删除“attr_accessible”的模型。我已经浏览了所有控制器,并为strong_params添加了一个方法,我在我的创建'中调用了这个方法。并且'更新'动作。我们没有使用' whitelist_attributes'或任何' mass_assignment_sanitizer'选项。并且,我的所有规格测试都在通过。

我的问题是,这个警告只是一个标准输出还是来自铁路看到的东西我不是?想法?

非常感谢

0 个答案:

没有答案