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