polymorphic has_many from ActiveRecord::Base????

I have a polymorphic thingy called fields and I need to on each and
every model, so I'd like to do the has_many from the base class, like

ActiveRecord::Base.class_eval do
  has_many :fields, :as => :model, :dependent => true

It fails with this no method error (class_of_active_record_descendant)

base.rb:1369:in `class_of_active_record_descendant':NoMethodError:
undefined method `abstract_class?' for Object:Class

Is there a better way to do this???

Instead of doing a class_eval, have you tried this:

  has_many :fields, :as => :model, :dependent => true

If you put this in a some_name.rb file in your models, the AR::Base
class will be extended with the functionality, which will then be
inherited by your models. It might work...