acts_as_nested_set *** ArgumentError异常:未知密钥::订单

时间:2016-05-25 06:29:22

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

将rails3.2.21升级到4.1.9并且在类中我使用acts_as_nested_set并且两个班级之间存在has_many关系,请参阅下面的代码

class Area < ActiveRecord::Base
    acts_as_nested_set
    has_many :plans
end

class Plan < ActiveRecord::Base
     belongs_to :area
end

当我尝试计算

p = Plan.first

p.area    

通过终端上的错误,如 -

ActionView::Template::Error (Unknown key: :order. Valid keys are: :class_name, :class, :foreign_key, :validate, :autosave, :table_name, :before_add, :after_add, :before_remove, :after_remove, :extend, :primary_key, :dependent, :as, :through, :source, :source_type, :inverse_of, :counter_cache, :join_table):

如何解决?

1 个答案:

答案 0 :(得分:0)

这个问题是因为我使用了宝石

gem'awesome_nested_set','〜&gt; 2.1.6'

现在我已更新gem文件并添加gem

gem“awesome_nested_set”,'〜&gt; 3.0.0.rc.3'

现在修复了问题