2011-12-27 54 views
0

时,如何停止“DEPRECATION WARNING:primary_key_name is deprecated”在安装“rails3_acts_as_paranoid”之后,我得到了像这样的DEPRECATION WARNING。由于此警告日志(大量日志!),OutOfMemory错误发生。Rails:当我使用“rails3_acts_as_paranoid”

DEPRECATION WARNING: primary_key_name is deprecated and will be removed from Rails 3.2 (use foreign_key instead). (called from block in _app_views_xxx_index_html_erb__2332243026978558603_2180692200 at /Users/xxx/xxx/xxx/index.html.erb:11) 

index.html.erb:11 has this code 
<%= hoge.fuga.id %> 

有没有人有任何想法?

P.S.

的Rails版本3.1.3 =

rails3_acts_as_paranoid版本= 0.1.3

rails3_acts_as_paranoid引用(你可以看到 “PRIMARY_KEY_NAME” 这可能被弃用。) https://github.com/goncalossilva/rails3_acts_as_paranoid/blob/master/lib/rails3_acts_as_paranoid.rb

我可以执行找到方法没有使用“轨道控制台”的上述警告。 (.html.erb就错了..?)

+1

首先,这只是一个警告,可以忽略不计的就功能而言。其次,它听起来像acts_as_paranoid中的错误。你有没有考虑在Github上分一杯羹,做出改变,并发送一个拉取请求?这通常是开源软件的工作原理。 – Eric 2011-12-27 18:14:01

+0

@Eric非常感谢!你是对的,我必须学习更多并且问开源社区。我会这样做,我会暂时使用“ActiveSupport :: Deprecation.silenced = true”来缓存警告。 – zono 2011-12-28 15:10:25

回答

1

我有这个问题,我觉得在这个环节中soluction:

Github