# Problem with nested associations

**URL:** <https://www.ruby-forum.com/t/problem-with-nested-associations/103865>\
**Category:** Rails\
**Created:** [May 11, 2007, 4:01am UTC](https://www.ruby-forum.com/t/problem-with-nested-associations/103865 "2007-05-11T04:01:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianspaid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@brianspaid](https://www.ruby-forum.com/u/brianspaid)\
**Post date:** [May 11, 2007, 4:01am UTC](https://www.ruby-forum.com/t/problem-with-nested-associations/103865/1 "2007-05-11T04:01:58Z")

</div>

I have a department which has many courses which has many sections  
however when I try to access  
course.sections.create or create a section and save I get an error.

ActiveRecord::StatementInvalid: SystemStackError: stack level too  
deep: SELECT \* FROM courses WHERE (courses.department\_id = 1)

Any ideas what’s going on?
