[Rails] Re: Execute code when an inheritance happens, or disabling S

Alex Wayne rubyonrails at beautifulpixel.com
Thu Jul 27 18:05:51 GMT 2006


> Alex,
> 
> I'm assuming that you're the author of the plugin trying to figure
> out how to make a usage pattern of "just inherit from PluginClass" work.
> 
> If the ActiveRecord class defined in your plugin is *only* ever meant
> to be an abstract base class then the simplest solution is to tell
> ActiveRecord that the class is abstract:
> 
> class ThePluginClass < ActiveRecord::Base
>    self.abstract_class = true
> end
> 
> If your plugin also needs to supply a concrete instance then I'd also
> supply a ConcreteClass < ThePluginClass with the plugin.
> 
> Hope this helps,
> Trevor
> --
> Trevor Squires
> http://somethinglearned.com

Awesome.  You absolutely rock.  It worked perfectly.

And yes it is my plugin, and I am just trying to get the cleanest 
possible interface for it.

Thanks again!
-Alex

-- 
Posted via http://www.ruby-forum.com/.


More information about the Rails mailing list