# Saving dependent objects in a has\_many relationship

**URL:** <https://www.ruby-forum.com/t/saving-dependent-objects-in-a-has-many-relationship/149126>\
**Category:** Rails\
**Created:** [September 21, 2008, 2:22am UTC](https://www.ruby-forum.com/t/saving-dependent-objects-in-a-has-many-relationship/149126 "2008-09-21T02:22:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![surge](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@surge](https://www.ruby-forum.com/u/surge)\
**Post date:** [September 21, 2008, 2:22am UTC](https://www.ruby-forum.com/t/saving-dependent-objects-in-a-has-many-relationship/149126/1 "2008-09-21T02:22:40Z")

</div>

Hello everybody,

Quick question. Let’s say I have two models: Trouble\_Ticket and  
Issues. Trouble\_Ticket has\_many Issues and Issue belongs\_to  
Trouble\_Ticket – a classic has\_many.

When I do Trouble\_Ticket \<\< Issue, Issue is automatically inserted  
into the db. But if I do this:

x = Trouble\_Ticket.find :first  
x.issues {|issue| issue.status\_id = 2 }

… and then

x.save

… the issues are not automatically updated. Why?

I couldn’t find an answer to this anywhere.

Thanks for any clues.
