Ticket #3 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Setting :left_column and :right_column options prevents access to columns via accessors

Reported by: adam at inquisitsolutions dot com Assigned to: somebody
Priority: major Milestone: 0.1 with tests
Component: plugin Version: trunk
Keywords: Cc:

Description

I dropped in your better_nested_set plugin to a class I had used with the standard acts_as_nested_set, and began seeing failures on tests that passed previously. My model declares non-default names for :left_column (:lvn) and :right_column (:rvn), and after dropping in better_nested_set, these attributes started returning nil instead of the actual left and right values in my model.

Playing around with this, I found that although my attributes were still available (and contained the correct values) in the attributes hash, accessing these attributes using accessors returned nil.

I have managed to get this working by commenting out line 109 in better_nested_set.rb, which defines accessors for the attributes used for :left_column and :right_column.

I'm not sure why these are necessary, and this seems to solve my immediate problem... not sure if it will cause others!

Change History

08/09/06 17:28:00 changed by jcm

  • status changed from new to closed.
  • resolution set to fixed.

Hi adam,

I committed a corrected version (rev 6), where left, right and parent columns can be read but not written (raises exceptions). It seems wise to me that these structure columns be changed only by the nested_set code to ensure consistency in the sets. Does it solve your problem ?

10/10/06 13:28:15 changed by jcm

  • keywords deleted.
  • version set to trunk.
  • component changed from component1 to plugin.
  • milestone set to 0.1 with tests.