如何摆脱这个插件的 class_inheritable_attribute 弃用警告?
我收到有关我正在使用的插件的警告:
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from has_private_messages at /vendor/plugins/simple-private-messages/lib/has_private_messages_extensions.rb:17)
我在 https: //github.com/jongilbraith/simple-private-messages,但最近没有太多活动。
我不熟悉 class_inheritable_attribute...不知道如何自己修补它。有什么提示吗?
I'm getting this warning for a plugin I'm using:
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from has_private_messages at /vendor/plugins/simple-private-messages/lib/has_private_messages_extensions.rb:17)
I've created an issue at https://github.com/jongilbraith/simple-private-messages, but there isn't much recent activity on it.
I'm not familiar with class_inheritable_attribute... don't know how to patch this myself. Any hints?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 GitHub 上分叉该插件并找到对
class_inheritable_attribute
的调用并将其更改为class_attribute
。从vendor/plugins
目录中删除旧插件并添加新插件。这将删除弃用警告。Fork the plugin on GitHub and find the calls to
class_inheritable_attribute
and change them toclass_attribute
. Remove the old plugin from yourvendor/plugins
directory and add the new one. That would remove the deprecation warning.