Bugs: Browse | Submit New | Admin

[#20566] stack level too deep (SystemStackError)

Date:
2008-06-08 18:32
Priority:
3
Submitted By:
Nobody
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
stack level too deep (SystemStackError)

Detailed description
railroad -o doc/models.dot -M

/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/reflection.rb:220:in `derive_class_name': stack level
too deep (SystemStackError)
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/reflection.rb:106:in `class_name'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/reflection.rb:220:in `derive_class_name'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/reflection.rb:106:in `class_name'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/reflection.rb:220:in `derive_class_name'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/reflection.rb:106:in `class_name'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/reflection.rb:220:in `derive_class_name'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/reflection.rb:106:in `class_name'
	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/reflection.rb:220:in `derive_class_name'
	 ... 1437 levels...
	from /usr/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:26:in `generate'
	from /usr/lib/ruby/gems/1.8/gems/railroad-0.5.0/bin/railroad:47
	from /usr/bin/railroad:19:in `load'
	from /usr/bin/railroad:19

Add A Comment: Notepad

Please login


Followup

Message
Date: 2008-07-08 17:04
Sender: James Hunt

I received this error when I had incorrectly stated my has_many
:through relationship as

class Memberships
  belongs_to :role
  belongs_to :person
end

class Person
  has_many :memberships
  has_many :roles, :through => :memberships
end

class Role
  has_many :roles
  has_many :people, :through => :roles
end

I corrected the definition of the Role class to this:

class Role
  has_many :memberships
  has_many :people, :through => :memberships
end

and railroad -M worked successfully.

(I only found the problem with the -v flag set for railroad.)

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item