Hi Krishna,
Le 10 nov. 06, ? 23:16, Krishna Dole a ?crit :> Well, talking about scope and the problems I caused for root methods
> got me thinking about roots.
>
> There are currently inconsistencies with roots
> (http://opensource.symetrie.com/trac/better_nested_set/ticket/15)
Just replied on the ticket:
root? is kept only for compatibility with existent code; we''ll remove
it after 0.1 version (the one with tests and a working scope) is out.
Maybe we should correct root? to return correct info.
> I propose that a root is anything where parent_id IS NULL OR parent_id
> = 0. Many people (including myself) would never let parent_id = 0, but
> not everyone follows that convention, and adding the extra condition
> shouldn''t hurt anything.
Honnestly I''d prefer that root means parent=NULL.
But if it can fix root? to be consistent with root method, why not...
> Therefore, I think that we should get rid of the lft and rgt
> conditions in the root? method-- but I guess we should wait to change
> this. Also, I think that the child method should simply be def
> child?() !root? end.
I think we should get rid of root? and child? method after 0.1. When
would such methods have any use ?
Jean-Christophe Michel
--
symetrie.com
Better Nested Set for rails:
http://opensource.symetrie.com/trac/better_nested_set