# Update\_attributes! does not update nested model

**URL:** <https://www.ruby-forum.com/t/update-attributes-does-not-update-nested-model/159333>\
**Category:** Rails\
**Created:** [February 3, 2009, 3:53pm UTC](https://www.ruby-forum.com/t/update-attributes-does-not-update-nested-model/159333 "2009-02-03T15:53:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![darkofabijan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/5f9b8f/32.png) [@darkofabijan](https://www.ruby-forum.com/u/darkofabijan)\
**Post date:** [February 3, 2009, 3:53pm UTC](https://www.ruby-forum.com/t/update-attributes-does-not-update-nested-model/159333/1 "2009-02-03T15:53:28Z")

</div>

Hi!

I have updated my app to rails 2.3. I have form that has few nested  
models and I am happy that I can just write  
accepts\_nested\_attributes\_for :tasks, :allow\_destroy =\> true, but  
update\_attributes! does not update my nested model. I have tried  
update\_attributes, and it works. Any ideas?

Few lines from log:

update\_attributes:

SQL (0.1ms) BEGIN  
Education Update (0.3ms) UPDATE `educations` SET `institution` =  
‘ins’, `updated_at` = ‘2009-02-03 13:34:08’ WHERE `id` = 4  
SQL (0.4ms) COMMIT

update\_attributes!:  
SQL (0.1ms) BEGIN  
SQL (0.1ms) COMMIT

---

<div class="post-metadata">

**Author:** ![darkofabijan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/5f9b8f/32.png) [@darkofabijan](https://www.ruby-forum.com/u/darkofabijan)\
**Post date:** [February 5, 2009, 10:33am UTC](https://www.ruby-forum.com/t/update-attributes-does-not-update-nested-model/159333/2 "2009-02-05T10:33:10Z")

</div>

Hi,

I have uploaded a patch to fix this. Thanks for bringing it to my  
attention.  
[http://rails.lighthouseapp.com/projects/8994/tickets/1877](http://rails.lighthouseapp.com/projects/8994/tickets/1877)

Cheers,  
Eloy
