Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Problem with parent_id and parent methods #65

ksnyder opened this Issue · 1 comment

1 participant


Perhaps I misunderstand how these are supposed to work. I have persisted object with two generations of ancestry, thus:

@page = Page.find(params[:id]) "============== @page.ancestry=#{@page.ancestry}"        #  @page.ancestry=1/2 "============== @page.parent_id=#{@page.parent_id}"    #  @page.parent_id= "============== @page.parent=#{@page.parent.inspect}"  #  @page.parent=nil

I expected parent_id to return 2. Of course I could parse the ancestry value myself, but I think I'm just missing something here. Thx.


Solved. We migrated from acts_as_tree and I thought I would continue calling parent_id= to set an object's parent. I added an attr_accessor for parent_id, and this stepped on Ancestry's parent and parent_id methods.

@ksnyder ksnyder closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.