Nested _sets_

Hi,
could someone help me with a few hints, how can I implement real
nested sets behaviour – where I mean sets to be sets i.e. with
unique members, unordered, so no tree like structure, no siblings etc.
are needed

It’s seems too be too much for me.

Imagine accounts, where an account can have sub accounts and so on.
Then i’d like to query e.g. the sum transfered to an account or any
its children. Simple inserts (one parent, no siblngs), more complex
querys.

Like: sum(account.self_and_children.transfers).

I guess acts_as_tree is not what I’m looking for – it has no method
for retieving all the children and is not very effective performance
wise as I read.

Acts_as_nested_set requires left-right columns, what is unnenecessary
in my case.

So could you give me an advice?

Thx a lot!
PSz

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs