<?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: Read-only Models in ActiveRecord</title>
	<atom:link href="http://blog.zobie.com/2009/01/read-only-models-in-activerecord/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.zobie.com/2009/01/read-only-models-in-activerecord/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=read-only-models-in-activerecord</link>
	<description>I create software, I like music and I&#039;m mildly(?) OCD.</description>
	<lastBuildDate>Thu, 26 Jan 2012 00:05:11 -0800</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: zobie</title>
		<link>http://blog.zobie.com/2009/01/read-only-models-in-activerecord/comment-page-1/#comment-16480</link>
		<dc:creator>zobie</dc:creator>
		<pubDate>Tue, 11 Oct 2011 08:12:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.zobie.com/?p=75#comment-16480</guid>
		<description>I agree that enforcing constraints at the database level is a good approach. For the specific project I was working on when I wrote this article, I did not have access to make changes to the database itself. Because I tend to be paranoid, I wanted some assurance that data wasn&#039;t accidentally modified. :)</description>
		<content:encoded><![CDATA[<p>I agree that enforcing constraints at the database level is a good approach. For the specific project I was working on when I wrote this article, I did not have access to make changes to the database itself. Because I tend to be paranoid, I wanted some assurance that data wasn&#8217;t accidentally modified. <img src='http://blog.zobie.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pascal</title>
		<link>http://blog.zobie.com/2009/01/read-only-models-in-activerecord/comment-page-1/#comment-16430</link>
		<dc:creator>pascal</dc:creator>
		<pubDate>Sun, 09 Oct 2011 14:56:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.zobie.com/?p=75#comment-16430</guid>
		<description>why not ensure read only access on the db layer through proper user rights?
this would be more secure (your solution does not cover native sql)

pascal</description>
		<content:encoded><![CDATA[<p>why not ensure read only access on the db layer through proper user rights?<br />
this would be more secure (your solution does not cover native sql)</p>
<p>pascal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jmartorella</title>
		<link>http://blog.zobie.com/2009/01/read-only-models-in-activerecord/comment-page-1/#comment-4948</link>
		<dc:creator>jmartorella</dc:creator>
		<pubDate>Tue, 28 Dec 2010 01:29:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.zobie.com/?p=75#comment-4948</guid>
		<description>Thanks for this post.  I was doing something quite similar and found that you can still call delete and delete_all, as they do not use callback methods.  You can override those methods on your read only model and raise the ReadOnly exception in the exact same way:

&lt;code&gt;
 def self.delete_all
    raise ActiveRecord::ReadOnlyRecord
  end

  def delete
    raise ActiveRecord::ReadOnlyRecord
  end
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Thanks for this post.  I was doing something quite similar and found that you can still call delete and delete_all, as they do not use callback methods.  You can override those methods on your read only model and raise the ReadOnly exception in the exact same way:</p>
<p><code><br />
 def self.delete_all<br />
    raise ActiveRecord::ReadOnlyRecord<br />
  end</p>
<p>  def delete<br />
    raise ActiveRecord::ReadOnlyRecord<br />
  end<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WT</title>
		<link>http://blog.zobie.com/2009/01/read-only-models-in-activerecord/comment-page-1/#comment-3556</link>
		<dc:creator>WT</dc:creator>
		<pubDate>Sat, 27 Nov 2010 21:53:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.zobie.com/?p=75#comment-3556</guid>
		<description>Thanks,

I&#039;m using this with a materialized view that gets updated by plpgsql database functions and triggers.</description>
		<content:encoded><![CDATA[<p>Thanks,</p>
<p>I&#8217;m using this with a materialized view that gets updated by plpgsql database functions and triggers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zobie</title>
		<link>http://blog.zobie.com/2009/01/read-only-models-in-activerecord/comment-page-1/#comment-17</link>
		<dc:creator>zobie</dc:creator>
		<pubDate>Fri, 27 Feb 2009 23:14:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.zobie.com/?p=75#comment-17</guid>
		<description>I&#039;m really glad that it was helpful to you Jeremy!</description>
		<content:encoded><![CDATA[<p>I&#8217;m really glad that it was helpful to you Jeremy!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Walworth</title>
		<link>http://blog.zobie.com/2009/01/read-only-models-in-activerecord/comment-page-1/#comment-16</link>
		<dc:creator>Jeremy Walworth</dc:creator>
		<pubDate>Fri, 27 Feb 2009 23:05:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.zobie.com/?p=75#comment-16</guid>
		<description>Thanks for this post!  It came up on a Google search for &quot;activerecord and readonly&quot;.  I have a situation where a proposal is generated, and after that, several records need to be locked down. This is perfect for that!</description>
		<content:encoded><![CDATA[<p>Thanks for this post!  It came up on a Google search for &#8220;activerecord and readonly&#8221;.  I have a situation where a proposal is generated, and after that, several records need to be locked down. This is perfect for that!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

