Forum: Ruby on Rails Models and Modules and subclassing, oh my!

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
9cace61bc2a5972d44d5e1a1b8c145af?d=identicon&s=25 (Guest)
on 2007-01-17 01:05
(Received via mailing list)
So, our application has a large number of models at this point, and I'm
getting a bit worried about people having to use long names, as well as
clashes in the global namespace.  More recently I wanted to add a new
table with some STI subclasses of that table...

module Portal

class Portal::Base < ActiveRecord::Base
    belongs_to :widget

However, Widget is a top level class, Object::Widget.
What I find is that this generates an error, Portal::Widget
(portal/widget.rb) could not be found.  Is this a problem with the way
ruby or rails is attempting to load this class under the module?  I
suppose that it is ambiguous, did I mean Portal::Widget or
Object::Widget, but the ambiguity should be able to be resolved by the
fact that Portal::Widget doesn't exist, but Object::Widget does.

Has anyone dealt with this before?
This topic is locked and can not be replied to.