rails/rails — Issue #3847: has_many: undefined method `association_class' for nil:NilClass
Author: slayer
Created: 2011-12-04 03:42:18+00:00
State: open

Hi

I have been upgrading project to 3.1, and faced with lack of some has_many associations

I have model like this
class Device::Base < ActiveRecord::Base
...
has_many :queues, :class_name => Device::Queue.to_s, :foreign_key => 'device_id', :dependent => :destroy
...
end

So when I try to access queues:

d = Device::Base.last
d.queues
NoMethodError: undefined method `association_class' for nil:NilClass

I can see, that in d.reflections lack this and other associations

Of course in 3.0.10 there is everything fine