<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Thanks for the tip-off guys!<br>Cheers,<br>Simon<br><br><hr id="stopSpelling">From: ollylegg@gmail.com<br>Date: Fri, 11 Sep 2009 16:20:11 +0100<br>To: chat@lists.lrug.org<br>Subject: Re: [LRUG] Base class for model<br><br>
Yes, this is supported.<div><br></div><div>class MyBaseClass</div><div> self.abstract_class = true</div><div>end</div><div><br></div><div>class MySubClass < MyBaseClass</div><div>end</div><div><br></div><div><a href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html">http://api.rubyonrails.org/classes/ActiveRecord/Base.html</a></div><div><br><div><div>On 11 Sep 2009, at 16:17, Simon Sebright wrote:</div><br class="EC_Apple-interchange-newline"><blockquote>
<div id="EC_MailContainerBody" style="padding-right: 10px; padding-left: 10px; padding-top: 15px;">
<div><font face="Calibri">Hi</font></div>
<div><font face="Calibri"></font> </div>
<div><font face="Calibri">I was attempting to do a bit of refactoring. I had
one model class, in which I had defined a few operations. Then along came a
second one, where I wanted the same operations, so I started to create a common
base class for them, which naturally inherits from
ActiveRecord::Base</font></div>
<div><font face="Calibri"></font> </div>
<div><font face="Calibri">Now, I get all sorts of errors, and it looks like rails
is taking the base class name and assuming it'll find a table relating to it,
which in my case it won't.</font></div>
<div><font face="Calibri"></font> </div>
<div><font face="Calibri">Is this somehow supported, or should I be using a
module/mixin instead?</font></div>
<div><font face="Calibri"></font> </div>
<div><font face="Calibri">Thanks,<br>Simon</font></div></div>
_______________________________________________<br>Chat mailing list<br><a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>http://lists.lrug.org/listinfo.cgi/chat-lrug.org<br></blockquote></div><br></div><br /><hr />Use Hotmail to send and receive mail from your different email accounts. <a href='http://clk.atdmt.com/UKM/go/167688463/direct/01/' target='_new'>Find out how.</a></body>
</html>