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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Apr 22, 11:38 pm, "Alan Smith" <alan0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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" > endTry 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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Your guess was correct. It is the acts_as_nested_set (betternestedset) plugin. Thanks for your help!! --Alan On Wed, Apr 23, 2008 at 9:08 AM, Clever Neologism <gestahl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On Apr 22, 11:38 pm, "Alan Smith" <alan0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > 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 > > 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. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---