[3.1.0.rc4] Problem with reflections being empty causing whiny nil

Hi, I have an engine that worked perfectly on rails 3.0.x and now is breaking on a simple method. Basically it creates categories that can have subcategories but all with the same model. eg:

class Category < ActiveRecord::Base   belongs_to :parent, :class_name => 'Category'   has_many :subcategories, :class_name => 'Category', :foreign_key => :parent_id end

basically, what is happening is, everytime I call the category.subcategories method I get this error:

NoMethodError: undefined method `association_class' for nil:NilClass   from /Users/draiken/.rvm/gems/ruby-1.9.2-p180@eujafui/gems/ activesupport-3.1.0.rc4/lib/active_support/whiny_nil.rb:48:in `method_missing'   from /Users/draiken/.rvm/gems/ruby-1.9.2-p180@eujafui/gems/ activerecord-3.1.0.rc4/lib/active_record/associations.rb:163:in `association'   from /Users/draiken/.rvm/gems/ruby-1.9.2-p180@eujafui/gems/ activerecord-3.1.0.rc4/lib/active_record/associations/builder/ association.rb:41:in `block in define_readers'

I've noticed for some reason, category.reflections is empty

I've tried debugging and I really don't know what is wrong, since nothing changed besides the rails 3.1

Thanks in advance

Discovered it was an incompatibility issue with another gem ‘has_many_polymorphs’