[Betternestedset-talk] Questions, RC for 0.1?

Krishna Dole
2006-12-15T18:32:52Z

Hi Jean-Christophe,

Sorry to be so slow in responding.

> why not. Let''s change this before 0.1.
OK, I''ll make move_to_child_of insert on the right.

> I copied behaviour as much as possible from acts_as_tree.
Ah, I see that now. I suppose remaining consistent with the other
counter cache methods in rails is good. You are OK with changing it to
all_children_count, correct? (since the current name is inconsistent
with both acts_as_tree and our other methods)

> Don''t you think we''ll solve the problem by defining
>    attr_reader left_column_name
You mean so that when ActiveRecord goes to update, it gets nil for the
column values? That would still be a problem, because it would then
set the values to NULL.

>    or maybe, define #{left_column}=() {} method
> so none of left, right and parent could be set from code (only changed
> from sql)
We already prevent external assignment of lft/rgt, and ActiveRecord
needs to set those attributes when a record if fetched. The problem is
not that the values are being changed in the object, but that they are
being changed in the database when a separate object is moved/deleted,
and then if the record is saved, the (now incorrect) values get
written back to the database. ActiveRecord does not appear to have any
predefined way to exclude particular columns from the update
statement, hence my hack.

Please let me know if I''ve failed to see how the above might work.

I''m excited about how things are shaping up.

Cheers,
Krishna



>
> Jean-Christophe Michel
> --
> symetrie.com
>
> Better Nested Set for rails:
> http://opensource.symetrie.com/trac/better_nested_set
>
> _______________________________________________
> Betternestedset-talk mailing list
> Betternestedset-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/betternestedset-talk
>