To figure out the problem, I ran an update at the console and tailed
the development log in another window:

Window 1
$ script/console
>> (created a topic and then a post)

Window 2
$ tail -f log/development.log
Topic Update (0.000296)   UPDATE topics SET `forum_posts_count` =
`forum_posts_count` + 1 WHERE (`id` = 1)

So you're right, it doesn't change the topic updated_at column.  I'm
not sure why Active Record made that choice, but you can fix it by
using an after_create callback in the ForumPost model, something like

after_create :update_topic_updated_at
.
.
.
def update_topic_updated_at
  self.topic.updated_at = Time.now
  topic.save!
end


Michael

On Tue, Jun 24, 2008 at 8:41 PM, Fountain <[EMAIL PROTECTED]> wrote:
>
> Even though the forum_post_count is being updated, the actual
> updated_at time of a topic is not. Does anyone have an idea what may
> be overriding active record or otherwise causing this to not update?
>
> I'm trying to sort my topics by most recent activity and this is
> making it difficult.
> >
>



-- 
Michael Hartl
Insoshi social software
http://insoshi.com/

--~--~---------~--~----~------------~-------~--~----~
Insoshi developer site: http://dogfood.insoshi.com/
Insoshi documentation: http://docs.insoshi.com/

You received this message because you are subscribed to the Google
Groups "Insoshi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/insoshi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to