Extending ActiveRecord creates TypeError


#1

Hi.

I have want to use the following arrangement: Model < CustomClass <
ActiveRecord::Base

My CustomClass has a bunch of code I want to be held in common to all
my models.

What happens however is that if I access a controller that uses
Model, it works. Then on the second view (hitting reload) I always get:

TypeError (superclass mismatch for class User):
/app/models/account/user.rb:4
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/
active_support/dependencies.rb:207:in load' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/ active_support/dependencies.rb:207:inload’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/
active_support/dependencies.rb:39:in require_or_load' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/ active_support/dependencies.rb:22:independ_on’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/
active_support/dependencies.rb:178:in require_dependency' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/ active_support/dependencies.rb:178:inrequire_dependency’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/
action_controller/dependencies.rb:72:in require_dependencies' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/dependencies.rb:70:ineach’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/
action_controller/dependencies.rb:70:in require_dependencies' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/dependencies.rb:35:inmodel’
.//app/controllers/account_controller.rb:4

I don’t understand why! Does AR modify the superclass in some way
that makes extending model classes impossible?

Thanks