<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: When is a record really updated_at in Ruby on Rails (and the under-overlooked Observer class)?</title>
	<atom:link href="http://pushrod.wordpress.com/2007/11/09/when-is-a-record-really-updated_at-in-ruby-on-rails-and-the-under-overlooked-observer-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://pushrod.wordpress.com/2007/11/09/when-is-a-record-really-updated_at-in-ruby-on-rails-and-the-under-overlooked-observer-class/</link>
	<description>Old dogs, new tricks</description>
	<lastBuildDate>Sun, 30 Aug 2009 07:39:18 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Rob Cameron</title>
		<link>http://pushrod.wordpress.com/2007/11/09/when-is-a-record-really-updated_at-in-ruby-on-rails-and-the-under-overlooked-observer-class/#comment-163</link>
		<dc:creator>Rob Cameron</dc:creator>
		<pubDate>Mon, 20 Jul 2009 19:40:42 +0000</pubDate>
		<guid isPermaLink="false">http://pushrod.wordpress.com/2007/11/09/when-is-a-record-really-updated_at-in-ruby-on-rails-and-the-under-overlooked-observer-class/#comment-163</guid>
		<description>Rails 2.3.3, released today, finally has built-in support for a child model to automatically update its parent&#039;s updated_at field when the child is saved!  In the association that has the belongs_to association just add:

# /app/models/comment.rb
belongs_to :post, :touch =&gt; true

Now when you create/edit/delete a comment then the post it belongs to gets updated_at set to Time.now.  You can also name another field if you want:

# /app/models/comment.rb
belongs_to :post, :touch =&gt; :last_comment_at

Instead of Post.updated_at being set to now, Post.last_comment_at is set instead.</description>
		<content:encoded><![CDATA[<p>Rails 2.3.3, released today, finally has built-in support for a child model to automatically update its parent&#8217;s updated_at field when the child is saved!  In the association that has the belongs_to association just add:</p>
<p># /app/models/comment.rb<br />
belongs_to :post, :touch =&gt; true</p>
<p>Now when you create/edit/delete a comment then the post it belongs to gets updated_at set to Time.now.  You can also name another field if you want:</p>
<p># /app/models/comment.rb<br />
belongs_to :post, :touch =&gt; :last_comment_at</p>
<p>Instead of Post.updated_at being set to now, Post.last_comment_at is set instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ctagg</title>
		<link>http://pushrod.wordpress.com/2007/11/09/when-is-a-record-really-updated_at-in-ruby-on-rails-and-the-under-overlooked-observer-class/#comment-161</link>
		<dc:creator>ctagg</dc:creator>
		<pubDate>Thu, 26 Mar 2009 22:53:52 +0000</pubDate>
		<guid isPermaLink="false">http://pushrod.wordpress.com/2007/11/09/when-is-a-record-really-updated_at-in-ruby-on-rails-and-the-under-overlooked-observer-class/#comment-161</guid>
		<description>David
Good point. Thanks for the comment</description>
		<content:encoded><![CDATA[<p>David<br />
Good point. Thanks for the comment</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Reese</title>
		<link>http://pushrod.wordpress.com/2007/11/09/when-is-a-record-really-updated_at-in-ruby-on-rails-and-the-under-overlooked-observer-class/#comment-160</link>
		<dc:creator>David Reese</dc:creator>
		<pubDate>Thu, 26 Mar 2009 19:15:10 +0000</pubDate>
		<guid isPermaLink="false">http://pushrod.wordpress.com/2007/11/09/when-is-a-record-really-updated_at-in-ruby-on-rails-and-the-under-overlooked-observer-class/#comment-160</guid>
		<description>Hi,

Helpful post, thanks.

One update -- now, ActiveRecord records that are not changed do not have their updated_at timestamp updated when saved -- record.save does nothing to an unchanged record.  You have to do a record.update_attribute(:updated_at, Time.now), as you include above.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Helpful post, thanks.</p>
<p>One update &#8212; now, ActiveRecord records that are not changed do not have their updated_at timestamp updated when saved &#8212; record.save does nothing to an unchanged record.  You have to do a record.update_attribute(:updated_at, Time.now), as you include above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sazwqa</title>
		<link>http://pushrod.wordpress.com/2007/11/09/when-is-a-record-really-updated_at-in-ruby-on-rails-and-the-under-overlooked-observer-class/#comment-140</link>
		<dc:creator>sazwqa</dc:creator>
		<pubDate>Tue, 16 Dec 2008 04:48:08 +0000</pubDate>
		<guid isPermaLink="false">http://pushrod.wordpress.com/2007/11/09/when-is-a-record-really-updated_at-in-ruby-on-rails-and-the-under-overlooked-observer-class/#comment-140</guid>
		<description>nice writeup, useful !</description>
		<content:encoded><![CDATA[<p>nice writeup, useful !</p>
]]></content:encoded>
	</item>
</channel>
</rss>
