不推荐使用“ActiveRecord::Core::ClassMethods.find"调用 [英] 'ActiveRecord::Core::ClassMethods.find' call is deprecated

查看:33
本文介绍了不推荐使用“ActiveRecord::Core::ClassMethods.find"调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 RubyMine 2016.1,当我使用 ActiveRecord 的 find(id) 方法时,它向我显示了这个弃用警告:ActiveRecord::Core::ClassMethods.find"调用已弃用,然而,在 guide,不推荐使用主键查找.

I'm using RubyMine 2016.1 and when I use the find(id) method of ActiveRecord it shows me this deprecation warning: 'ActiveRecord::Core::ClassMethods.find' call is deprecated, however, in the guide, find with primary key is not deprecated.

推荐答案

这似乎是 Rubymine 2016.1 中的已知错误.如果您愿意,您可以跟踪此错误报告,并且可以放心地忽略此弃用警告.

This seems to be a known bug in Rubymine 2016.1. You can track this bug report if you like and you can safely ignore this deprecation warning.

更新:这个错误似乎在 Rubymine 2016.1.1 安全版本中现在修复.IDE 不再将此语句注释为已弃用.

Update: the bug seems to be fixed now in the Rubymine 2016.1.1 security release. The IDE no longer annotates this statement as deprecated.

这篇关于不推荐使用“ActiveRecord::Core::ClassMethods.find"调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆