Updated_at not updating

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

Any suggestions would be helpful



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”

On Apr 22, 11:38 pm, “Alan S.” [email protected] wrote:

t.text     "notes"
t.integer  "user_id"


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.

Your guess was correct. It is the acts_as_nested_set
(betternestedset) plugin. Thanks for your help!!


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs