<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Moserei &#187; single table inheritance</title>
	<atom:link href="http://moserei.de/index.php/tag/single-table-inheritance/feed" rel="self" type="application/rss+xml" />
	<link>http://moserei.de</link>
	<description></description>
	<lastBuildDate>Tue, 06 Jul 2010 16:18:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sequel single table inheritance</title>
		<link>http://moserei.de/index.php/164/sequel-single-table-inheritance</link>
		<comments>http://moserei.de/index.php/164/sequel-single-table-inheritance#comments</comments>
		<pubDate>Tue, 20 Oct 2009 22:08:24 +0000</pubDate>
		<dc:creator>Moser</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[sequel]]></category>
		<category><![CDATA[single table inheritance]]></category>
		<category><![CDATA[sti]]></category>

		<guid isPermaLink="false">http://moserei.de/?p=164</guid>
		<description><![CDATA[Sequel&#8217;s STI is not so well documented as ActiveRecord&#8217;s is. Because it cost me about 20 minutes to find out about it&#8217;s syntax, I post a little example.

class A &#60; Sequel::Model
  plugin :single_table_inheritance, :object_type
end
&#160;
class B &#60; A
end

The second argument is the name of the column to be used to store the class name in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sequel.rubyforge.org/">Sequel</a>&#8217;s STI is not so well documented as ActiveRecord&#8217;s is. Because it cost me about 20 minutes to find out about it&#8217;s syntax, I post a little example.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> A <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">Sequel::Model</span>
  plugin <span style="color:#ff3333; font-weight:bold;">:single_table_inheritance</span>, <span style="color:#ff3333; font-weight:bold;">:object_type</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> B <span style="color:#006600; font-weight:bold;">&lt;</span> A
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>The second argument is the name of the column to be used to store the class name in DB. Don&#8217;t use &#8216;type&#8217; here, it collides with Ruby&#8217;s Object#type.<br />
This works with version 3.5.0 and should work with any version >= 2.12.0.</p>
]]></content:encoded>
			<wfw:commentRss>http://moserei.de/index.php/164/sequel-single-table-inheritance/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
