Non-Fatal Anonymous Module Error

I originally posted this to rails-core and was told to move it here, so here it is. I am receiving the following non-fatal error from Rails for a particular action:

Error calling Dispatcher.dispatch #<ArgumentError: Anonymous modules have no name to be referenced by>

./script/…/config/…/vendor /rails/activesupport/lib

/active_support/dependencies.rb:313:in `to_constant_name’

./script/…/config/…/vendor/rails/activesupport/lib/active_support/dependencies.rb:270:in autoloaded?' ./script/../config/../vendor/rails/activerecord/lib/active_record/base.rb:278:in reset_subclasses’ ./script/…/config/…/vendor/rails/activerecord/lib/active_record/base.rb:277:in `reset_subclasses’

./script/…/config/…/vendor/rails/railties/lib/dispatcher.rb:57:in reset_application!' ./script/../config/../vendor/rails/railties/lib/dispatcher.rb:110:in reset_after_dispatch’ ./script/…/config/…/vendor/rails/railties/lib/dispatcher.rb:50:in `dispatch’

/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.1/lib/mongrel/rails.rb:85:in `process’

/usr/local/lib/ruby/gems/1.8/gems/mongrel- 0.3.13.1/lib/mongrel.rb:556:in process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-[0.3.13.1/lib/mongrel.rb:555:in ](http://0.3.13.1/lib/mongrel.rb:555:in) process_client’ /usr/local/lib/ruby/gems/1.8/gems/mongrel- 0.3.13.1/lib/mongrel.rb:624:in `run’ /usr/local/lib/ruby/gems/1.8/gems/mongrel-[

0.3.13.1/lib/mongrel.rb:623:in](http://0.3.13.1/lib/mongrel.rb:623:in) `run’

/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.1/lib/mongrel.rb:612:in run' /usr/local/lib/ruby/gems/1.8/gems/mongrel- [ 0.3.13.1/lib/mongrel.rb:952:in](http://0.3.13.1/lib/mongrel.rb:952:in) run’ /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.1/lib/mongrel.rb:951:in run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-[ 0.3.13.1/bin/mongrel_rails:119:in](http://0.3.13.1/bin/mongrel_rails:119:in) run’ /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.1/lib/mongrel/command.rb:211:in run' /usr/local/lib/ruby/gems/1.8/gems/mongrel- [0.3.13.1/bin/mongrel_rails:227](http://0.3.13.1/bin/mongrel_rails:227) ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:393:in load’

./script/…/config/…/vendor/rails/railties/lib/commands/servers/mongrel.rb:48

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in require' ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:400:in require’ ./script/…/config/…/vendor/rails/railties/lib/commands/server.rb:39

script/server:3

I have a feeling it has something to do with this little bit of code:

aggregate_class = Class.new(ActiveWarehouse::Aggregate)

ActiveWarehouse::Aggregate extends from ActiveRecord::Base and aggregate extension classes are created on-the-fly. Is there a proper way for me to construct these classes in memory without causing this error?

One suggestion already made was to override autoloaded? and return false in ActiveWarehouse::Aggregate, which I tried to no avail (Dependencies is not mixed into AR::Base nor does AR::Base extend from Dependencies, so there is no autoloaded? method to override in AR::Base).

Any other suggestions would be appreciated. Thanks.

V/r Anthony Eden