Scott Seago
2008-Apr-22 14:32 UTC
[Betternestedset-talk] Support for find options in queries (:include and :conditions, etc.)
Has there been any work on supporting the various find options in the betternestedset methods. Right now there''s no way to pass on, for example, the :include option to the find method to retrieve associations when calling API methods such as self_and_siblings, etc. I''d also like to be able to pass :conditions so that I can filter the results -- for example, my current nested set model also uses single table inheritance. I''d like to be able to return a list of siblings that is the same type as the current object. It looks like it would be relatively straightforward to handle a few specific use cases -- such as the above. I''d just have to modify the various API methods to accept an options arg, modify :conditions to include the nested set conditions bits, and pass it along to the find method. Scott
Jean-Christophe Michel
2008-Apr-23 12:48 UTC
[Betternestedset-talk] Support for find options in queries (:include and :conditions, etc.)
Hi Scott, Le 22 avr. 08 ? 16:32, Scott Seago a ?crit :> Has there been any work on supporting the various find options in the > betternestedset methods. Right now there''s no way to pass on, for > example, the :include option to the find method to retrieve > associations > when calling API methods such as self_and_siblings, etc. I''d also like > to be able to pass :conditions so that I can filter the results -- for > example, my current nested set model also uses single table > inheritance. > I''d like to be able to return a list of siblings that is the same type > as the current object. > > It looks like it would be relatively straightforward to handle a few > specific use cases -- such as the above. I''d just have to modify the > various API methods to accept an options arg, modify :conditions to > include the nested set conditions bits, and pass it along to the find > method.Your contribution is welcome. You can either send a patch to the list or ask for a commit access on the svn repository, if you plan to add many features. Jean-Christophe Michel -- symetrie.com Better Nested Set for rails: http://opensource.symetrie.com/trac/better_nested_set