[Nitro] Recursive structures with Og

George Moschovitis george.moschovitis at gmail.com
Thu Aug 4 06:34:03 EDT 2005


Better have a look at:

lib/og/mixin/hierarchivcal.rb
test/og/mixin/tc_hierarchical.rb

-g.

On 8/4/05, Miikka Koskinen <arcatan at gmail.com> wrote:
> Hello!
> 
> I'm wondering how to build recursive database structures with Og. Like this:
> 
>   class Foo
>     belongs_to parent, Foo
>     has_many children, Foo
>   end
> 
>   bar = Foo[1]
>   bar.children.each do |child|
>     # ..
>   end
> 
> 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.
> 
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
> 


-- 
http://www.gmosx.com
http://www.nitrohq.com
http://www.joy.gr




More information about the Nitro-general mailing list