loobmedia - webdevelopment
2007-Jan-04 20:31 UTC
[Betternestedset-talk] with_scope integration
Hi all, I''m thinking about adding proper scoping for all (sub)node related queries using with_scope. That way one can easily do this for example: node.children(:conditions => ["type = ?", ''folder''], :order => ''nodes.name'', :include => :metadata) It looks like this addition could be useful anywhere base_set_class.find is called, propably by having a new method find_node which will take care of wrapping the scope in with_scope. I''d like to contribute these additions (and tests). Any thoughts on this? Regards, Fabien Franzen
Hi Fabien, That sounds promising-- and if I understand correctly, would also (elegantly) close http://opensource.symetrie.com/trac/better_nested_set/ticket/18. I''m looking forward to seeing your changes. Be sure you grab the source from rubyforge (svn co svn://rubyforge.org/var/svn/betternestedset) instead of trac. Also, unfortunately testing is broken under Rails 1.2 rc1 (but if you see a way to fix it... :) cheers, Krishna On 1/4/07, loobmedia - webdevelopment <info at loobmedia.com> wrote:> Hi all, > > I''m thinking about adding proper scoping for all (sub)node related > queries using with_scope. That way one can easily do this for example: > > node.children(:conditions => ["type = ?", ''folder''], :order => > ''nodes.name'', :include => :metadata) > > It looks like this addition could be useful anywhere > base_set_class.find is called, propably by having a new method > find_node which will take care of wrapping the scope in with_scope. > > I''d like to contribute these additions (and tests). Any thoughts on > this? > > Regards, > > Fabien Franzen > _______________________________________________ > Betternestedset-talk mailing list > Betternestedset-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/betternestedset-talk >