[Nitro] Recursive structures with Og

Miikka Koskinen arcatan at gmail.com
Thu Aug 4 06:09:46 EDT 2005


I'm wondering how to build recursive database structures with Og. Like this:

  class Foo
    belongs_to parent, Foo
    has_many children, Foo

  bar = Foo[1]
  bar.children.each do |child|
    # ..

The problem is that then Og tries to SELECT * FROM ogfoo WHERE foo_oid
= 1. I think I've seen a solution on this list or somewhere, but I
can't find it.

More information about the Nitro-general mailing list