On 28/11/2011, at 5:52 PM, Dmytrii Nagirniak wrote: > I wonder how you guys work with the persistent ordered graph structures. > > What I need to be able to do is to propagate all the changes from a node to > all its child nodes recursively. > > A node is basically a permission (loaded with the information, such as > subject, user, company etc) that is propagated through to the other nodes.
Is "propagating changes to all child node recursively" a strategy to improve query performance? If so, you might look at an ActiveRecord extension such as my "Arboreal" (shameless plug), or DHH's "acts_as_nested_set", to allow efficient queries on a tree structure. https://github.com/mdub/arboreal https://github.com/rails/acts_as_nested_set I did presentation last year, that included an example of using Arboreal to query down a hierarchy (e.g. of roles or groups) while joining with another table (e.g. permissions). See page 10 of: http://www.slideshare.net/mdubya/one-project-3-gems -- cheers, Mike Williams -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en.
