I'm building an a client/web application that will rely on custom,
simple plugins that will be written as models with single table
inheritance to a Widget class. Ideally somebody would just need to
create a simple model which extends the parent, placed in the correct
directory and it work "just work". I'm avoiding the rails plugin
architecture because it should be stupid simple for people to build
and install. Unfortunately I'm not sure how to:
* Configure Rails to load models from a directory other than /app/
models/ (is this a 'require' in the environment.rb?)
* Get a list of all model objects which inherit from the parent
class. They will not have database records at first so I cannot rely
on a DB query.
Here's a high level look at how the model plugin would look:
class HelloWorld < Widget
# Create a serialized hash of default options
# Will be called by the system automatically to execute this plugin
say "Hello World"
Ideally it would live in RAILS_ROOT/widgets/ directory.
The application will need to know of all the Widget sub-classes in
order to automatically call their 'install' and 'run' functions. I'm
also considering doing this in Merb, but I have the most experience in
Rails and it's for a 24 hour hackfest (at Yahoo!), so I need to build