# Updated\_at not updating

**URL:** <https://www.ruby-forum.com/t/updated-at-not-updating/135556>\
**Category:** Rails\
**Created:** [April 23, 2008, 5:38am UTC](https://www.ruby-forum.com/t/updated-at-not-updating/135556 "2008-04-23T05:38:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![apswartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/71e660/32.png) [@apswartz](https://www.ruby-forum.com/u/apswartz)\
**Post date:** [April 23, 2008, 5:38am UTC](https://www.ruby-forum.com/t/updated-at-not-updating/135556/1 "2008-04-23T05:38:46Z")

</div>

How strange? I have a model that has updated\_at as a “magic” field in  
the database. But it isn’t updating unless I update it manually.

Doing a google search, I saw someone else having a similar problem  
that was using one of the acts\_as\_taggable plugins.

I am using acts\_as\_taggable\_on\_steroids AND betternestedset in this  
model

Any suggestions would be helpful

Thanks!

–Alan

Rails 2.0.2  
From schema.rb, the affected model:  
create\_table “tasks”, :force =\> true do |t|  
t.string “description”  
t.boolean “done”  
t.datetime “created\_at”  
t.datetime “updated\_at”  
t.integer “lft”  
t.integer “rgt”  
t.integer “parent\_id”  
t.text “notes”  
t.integer “user\_id”  
end

---

<div class="post-metadata">

**Author:** ![apswartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/71e660/32.png) [@apswartz](https://www.ruby-forum.com/u/apswartz)\
**Post date:** [April 23, 2008, 4:09pm UTC](https://www.ruby-forum.com/t/updated-at-not-updating/135556/2 "2008-04-23T16:09:28Z")

</div>

On Apr 22, 11:38 pm, “Alan S.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> t.text "notes"
> t.integer "user_id"
> 
> ```
> 
> end

Try taking off the two plugins to the model, and see if that affects  
it (just test real quick in script/console).

My guess is one, or both, of these plugins (or you) overrode the  
default AR “update” method with their own and did not include the  
updated\_at magic. At worst, you can always add a before\_save callback  
that sets the field manually.

---

<div class="post-metadata">

**Author:** ![apswartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/71e660/32.png) [@apswartz](https://www.ruby-forum.com/u/apswartz)\
**Post date:** [April 23, 2008, 6:28pm UTC](https://www.ruby-forum.com/t/updated-at-not-updating/135556/3 "2008-04-23T18:28:48Z")

</div>

Your guess was correct. It is the acts\_as\_nested\_set  
(betternestedset) plugin. Thanks for your help!!

–Alan
