<?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: Paranoid Deletion in DBIx::Class</title>
	<atom:link href="http://blog.afoolishmanifesto.com/archives/274/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.afoolishmanifesto.com/archives/274</link>
	<description>fREWdiculous!</description>
	<lastBuildDate>Fri, 30 Jul 2010 15:07:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Darren Duncan</title>
		<link>http://blog.afoolishmanifesto.com/archives/274/comment-page-1#comment-979</link>
		<dc:creator>Darren Duncan</dc:creator>
		<pubDate>Thu, 04 Feb 2010 09:04:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.afoolishmanifesto.com/?p=274#comment-979</guid>
		<description>If you&#039;re going to be paranoid about deletes, you need to be paranoid about updates too, as updates can easily be just as destructive.  Hence change auditing records are good.</description>
		<content:encoded><![CDATA[<p>If you&#8217;re going to be paranoid about deletes, you need to be paranoid about updates too, as updates can easily be just as destructive.  Hence change auditing records are good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt S Trout</title>
		<link>http://blog.afoolishmanifesto.com/archives/274/comment-page-1#comment-84</link>
		<dc:creator>Matt S Trout</dc:creator>
		<pubDate>Thu, 12 Mar 2009 19:04:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.afoolishmanifesto.com/?p=274#comment-84</guid>
		<description>Yeah, erm, Jess is the DBIC docs lead, she wrote a lot of the cookbook.

If you put that line -under- the -&gt;table call it&#039;d work fine. Equally, given __PACKAGE__-&gt;load_namespaces in your schema instead of load_classes you could have a default resultset class without any typing at all.

I&#039;d suggest you look at DBIx-Class-Journal in svn for a better approach than this though - your current system scales kinda horribly over time and I&#039;d suggest you&#039;ll find having separate audit tables much more effective.</description>
		<content:encoded><![CDATA[<p>Yeah, erm, Jess is the DBIC docs lead, she wrote a lot of the cookbook.</p>
<p>If you put that line -under- the -&gt;table call it&#8217;d work fine. Equally, given __PACKAGE__-&gt;load_namespaces in your schema instead of load_classes you could have a default resultset class without any typing at all.</p>
<p>I&#8217;d suggest you look at DBIx-Class-Journal in svn for a better approach than this though &#8211; your current system scales kinda horribly over time and I&#8217;d suggest you&#8217;ll find having separate audit tables much more effective.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fREW Schmidt</title>
		<link>http://blog.afoolishmanifesto.com/archives/274/comment-page-1#comment-83</link>
		<dc:creator>fREW Schmidt</dc:creator>
		<pubDate>Thu, 12 Mar 2009 14:09:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.afoolishmanifesto.com/?p=274#comment-83</guid>
		<description>@Jess: Yeah, I have learned a lot of the things you mention since I wrote that article.  The attributes thing you mention is also very important as that applies to joins from other models as well, vs my search which doesn&#039;t.

I tried your last part initially and it didn&#039;t work.  I recommend looking at the cookbook for why: you have to instantiate the model before you set the resultset_class, so you have to do it in table.  I could be wrong about that, but a co-worker and I tried it just yesterday outside of table and we had no luck until we put it in the table method.</description>
		<content:encoded><![CDATA[<p>@Jess: Yeah, I have learned a lot of the things you mention since I wrote that article.  The attributes thing you mention is also very important as that applies to joins from other models as well, vs my search which doesn&#8217;t.</p>
<p>I tried your last part initially and it didn&#8217;t work.  I recommend looking at the cookbook for why: you have to instantiate the model before you set the resultset_class, so you have to do it in table.  I could be wrong about that, but a co-worker and I tried it just yesterday outside of table and we had no luck until we put it in the table method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jess Robinson</title>
		<link>http://blog.afoolishmanifesto.com/archives/274/comment-page-1#comment-82</link>
		<dc:creator>Jess Robinson</dc:creator>
		<pubDate>Thu, 12 Mar 2009 08:39:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.afoolishmanifesto.com/?p=274#comment-82</guid>
		<description>Hi fREW,

A few things to point out about this method:

deleted_date =&gt;  \&quot;IS NULL&quot; is spelt deleted_date =&gt; undef, in DBIx::Class (and SQL::Abstract, which is the bit that actually turns the syntax into SQL).

Overriding search is a bit odd. It won&#039;t be called when you fetch items of this class via a relation, so those will get deleted items as well. If you never want to fetch deleted items, you can add a permanent extra where-clause to all resultsets of this class:

  __PACKAGE__-&gt;resultset_attributes({ where =&gt; { deleted_date =&gt; undef } });

If you ever need to access the deleted ones for any purpose, you&#039;ll need to add a second result class without this line.

Lastly, why override the table() sub when you can just do:
   __PACKAGE__-&gt;resultset_class(&#039;ACD::ParanoidResultSet&#039;);

in your Result class.

Jess</description>
		<content:encoded><![CDATA[<p>Hi fREW,</p>
<p>A few things to point out about this method:</p>
<p>deleted_date =&gt;  \&#8221;IS NULL&#8221; is spelt deleted_date =&gt; undef, in DBIx::Class (and SQL::Abstract, which is the bit that actually turns the syntax into SQL).</p>
<p>Overriding search is a bit odd. It won&#8217;t be called when you fetch items of this class via a relation, so those will get deleted items as well. If you never want to fetch deleted items, you can add a permanent extra where-clause to all resultsets of this class:</p>
<p>  __PACKAGE__-&gt;resultset_attributes({ where =&gt; { deleted_date =&gt; undef } });</p>
<p>If you ever need to access the deleted ones for any purpose, you&#8217;ll need to add a second result class without this line.</p>
<p>Lastly, why override the table() sub when you can just do:<br />
   __PACKAGE__-&gt;resultset_class(&#8216;ACD::ParanoidResultSet&#8217;);</p>
<p>in your Result class.</p>
<p>Jess</p>
]]></content:encoded>
	</item>
</channel>
</rss>
