简体   繁体   English

Rails测试在attr_encrypted上引发了弃用警告

[英]Rails test throwing Deprecation Warning over attr_encrypted

Rails test is throwing a deprecation warning over a gem (attr_encrypted) which is already updated to the latest version. Rails测试对已更新为最新版本的gem(attr_encrypted)发出弃用警告。 It reads: 内容为:

DEPRECATION WARNING: <custom_attribute_name> is not an attribute known to Active Record. This behavior is deprecated and will be removed in DEPRECATION WARNING: <custom_attribute_name> is not an attribute known to Active Record. This behavior is deprecated and will be removed in DEPRECATION WARNING: <custom_attribute_name> is not an attribute known to Active Record. This behavior is deprecated and will be removed in to Active Record. This behavior is deprecated and will be removed in the next version of Rails. If you'd like <custom_attribute_name> to be to Active Record. This behavior is deprecated and will be removed in the next version of Rails. If you'd like <custom_attribute_name> to be to Active Record. This behavior is deprecated and will be removed in the next version of Rails. If you'd like <custom_attribute_name> to be the next version of Rails. If you'd like <custom_attribute_name> to be managed by Active Record, add attribute :<custom_attribute_name> to your class. the next version of Rails. If you'd like <custom_attribute_name> to be managed by Active Record, add attribute :<custom_attribute_name> to your class. managed by Active Record, add attribute :<custom_attribute_name> to your class.

Not sure what it is asking me to do... it must be declared using attr_encrypted. 不确定它要我做什么...必须使用attr_encrypted声明它。

The deprecation warning is something the attr_encrypted gem needs to fix, but it seems there is a workaround by adding the attribute call as mentioned in the warning. 弃用警告是attr_encrypted gem需要修复的问题,但似乎有一种解决方法,可以通过添加警告中提到的属性调用来解决。

See https://github.com/attr-encrypted/attr_encrypted/issues/260 参见https://github.com/attr-encrypted/attr_encrypted/issues/260

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM