Using acts_as_list, acts_as_tree, and STI in one model

Check it out y’all:
(pastie was down)

I’m trying to make a tree which belongs_to another model, where you can
have sections or items as children, and sections can have sections or
items as well. Moreover, any siblings should be sortable.

For instance:


  • Section 1
    • Item A
    • Item B
  • Item C
  • Section 2
    • Item D
    • Section 3
      • Item E
    • Item F


Those items are going to be “has_one” with another model.

Right now I’m getting this error: NameError: undefined local variable or
method `parent_id’ but more generally, is there anything wrong with my