范围导致未定义的方法`const_defined?'

Mar*_*arc 2 ruby-on-rails ruby-on-rails-3

这是我的范围:

scope :parents, where("categories.parent_category_id IS NULL")
scope :children_of, lambda { |parent| where("categories.parent_category_id = ?", parent) }
Run Code Online (Sandbox Code Playgroud)

我不完全确定他们有什么问题.任何帮助,将不胜感激.谢谢!

更新:

这是错误......

undefined method `const_defined?' for #<Category:0x112ccfdb8>
Run Code Online (Sandbox Code Playgroud)

这里有完整的跟踪:https://gist.github.com/1186122

eta*_*ker 6

调用范围parents也会破坏acts_as_nested_setv1.4.4