# stack level too deep

**URL:** <https://discuss.rubyonrails.org/t/stack-level-too-deep/58108>\
**Category:** rubyonrails-talk\
**Created:** [March 26, 2011, 9:25pm UTC](https://discuss.rubyonrails.org/t/stack-level-too-deep/58108 "2011-03-26T21:25:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [March 26, 2011, 9:25pm UTC](https://discuss.rubyonrails.org/t/stack-level-too-deep/58108/1 "2011-03-26T21:25:00Z")

</div>

Hello...

I'm having a stack level too deep error using Ruby 1.8.7 with Rails 3.0.4 and with the rails console I performed the following commands.

leo%\>rails console Loading development environment (Rails 3.0.4) ruby-1.8.7-head \> leo = Organization.find(1)

SystemStackError: stack level too deep from /app/models/organization.rb:105:in `parents'

Here is the object that is having issues..

class Organization \< ActiveRecord::Base

&nbsp;&nbsp;has\_many :group\_organizations, :dependent =\> :delete\_all &nbsp;&nbsp;has\_many :groups, :through =\> :group\_organizations

&nbsp;&nbsp;has\_many :orders &nbsp;&nbsp;has\_many :product\_contracts

&nbsp;&nbsp;has\_many :people &nbsp;&nbsp;accepts\_nested\_attributes\_for :people

&nbsp;&nbsp;has\_many :addresses &nbsp;&nbsp;accepts\_nested\_attributes\_for :addresses

&nbsp;&nbsp;has\_many :organizations &nbsp;&nbsp;has\_many :departments &nbsp;&nbsp;has\_many :organization\_credits

&nbsp;&nbsp;has\_many :documents

&nbsp;&nbsp;validates\_presence\_of :name

&nbsp;&nbsp;&nbsp;&nbsp;def self.parents &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#@organizations = self.find :all, :conditions =\> ['is\_company = ? ',true] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@organizations = Organization.where("is\_company = ?",true) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#@organization\_parents = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select\_choice = I18n.t("select") + " "+ I18n.t("segments.description") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@organization\_parents = [select\_choice] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for organization in @organizations &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@organization\_parents \<\< [organization.name, organization.id] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return @organization\_parents &nbsp;&nbsp;&nbsp;&nbsp;end
