<?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/"
		>
<channel>
	<title>Comments on: Bypassing mass assignment for update_attributes</title>
	<atom:link href="http://blog.lrdesign.com/2009/03/bypassing-mass-assignment-for-update_attributes/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lrdesign.com/2009/03/bypassing-mass-assignment-for-update_attributes/</link>
	<description>Logical Reality Design: Web Design and Software Development</description>
	<lastBuildDate>Wed, 14 Jul 2010 20:46:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Evan</title>
		<link>http://blog.lrdesign.com/2009/03/bypassing-mass-assignment-for-update_attributes/comment-page-1/#comment-3103</link>
		<dc:creator>Evan</dc:creator>
		<pubDate>Tue, 17 Mar 2009 21:22:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lrdesign.com/?p=51#comment-3103</guid>
		<description>Oh, indeed - yours is the correct way, and I&#039;ve modified the post.

I had been lazy and not looked up update_attributes in the API, simply assuming that the difference between update_attributes and update_attributes! was the same as the difference between toggle and toggle! ... i.e. that without the bang, it updates the attribs in memory but does not save the record.

Instead, of course, it&#039;s the same as the difference between save and save!; the difference is not whether it saves, but whether it returns an error if the record is invalid and the save fails.

This is a case where a little more consistency from the API would be lovely...  :-)</description>
		<content:encoded><![CDATA[<p>Oh, indeed &#8211; yours is the correct way, and I&#8217;ve modified the post.</p>
<p>I had been lazy and not looked up update_attributes in the API, simply assuming that the difference between update_attributes and update_attributes! was the same as the difference between toggle and toggle! &#8230; i.e. that without the bang, it updates the attribs in memory but does not save the record.</p>
<p>Instead, of course, it&#8217;s the same as the difference between save and save!; the difference is not whether it saves, but whether it returns an error if the record is invalid and the save fails.</p>
<p>This is a case where a little more consistency from the API would be lovely&#8230;  <img src='http://blog.lrdesign.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Hartl</title>
		<link>http://blog.lrdesign.com/2009/03/bypassing-mass-assignment-for-update_attributes/comment-page-1/#comment-3100</link>
		<dc:creator>Michael Hartl</dc:creator>
		<pubDate>Tue, 17 Mar 2009 18:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lrdesign.com/?p=51#comment-3100</guid>
		<description>What&#039;s funny is that I recently added the same methods independently. You (though not the other readers of this blog) can verify this by doing a git pull and a git log on the private project we&#039;ve been working on together; you&#039;ll see that I added unsafe_update_attributes(!) on February 12, and the code is virtually identical to yours. (The only difference, apart from the method order, is a missing &#039;save&#039; in your unsafe_update_attributes, which I think you need to add, since unsafe_update_attributes should change the attributes in the database as well as the ones in memory.)</description>
		<content:encoded><![CDATA[<p>What&#8217;s funny is that I recently added the same methods independently. You (though not the other readers of this blog) can verify this by doing a git pull and a git log on the private project we&#8217;ve been working on together; you&#8217;ll see that I added unsafe_update_attributes(!) on February 12, and the code is virtually identical to yours. (The only difference, apart from the method order, is a missing &#8216;save&#8217; in your unsafe_update_attributes, which I think you need to add, since unsafe_update_attributes should change the attributes in the database as well as the ones in memory.)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
