Re: Re: stack level too deep

Yes so you can’t just exclude the current, I’m not sure but I still
think that it comes from the fact that each company has_many companies
relationship which leads to the recursion. This shows up on the first
place where you are looking up a company to be resolved to an object.
Since the class has the property parents this is trying to be resolved
and therefor the line asking for Organization.where(…) shows up as the
error. My guess at least…

On 2011-03-27 00:38:08 +0100, [email protected] Wrote:

On 26 March 2011 23:44, Philipp F. [email protected]
wrote:

Yes so you can’t just exclude the current, I’m not sure but I still think that
it comes from the fact that each company has_many companies relationship which
leads to the recursion. This shows up on the first place where you are looking up
a company to be resolved to an object. Since the class has the property parents
this is trying to be resolved and therefor the line asking for
Organization.where(…) shows up as the error. My guess at least…

There could be recursion there if any record has one of its
descendents as its parent, but the OP said he commented it and still
had the problem… so it’s probably not what’s causing this issue
right now.

I wonder about what the “parents” functionality is for… if it’s to
allow the model to act as a nested set, I’d be inclined to use a Gem
that adds that ability, rather than rolling my own…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs