Hey folks,
I have following models:
class App::Module::Object < AR::Base
has_many :objects, :class_name => 'App::OtherModule::Object'
end
and
class App::OtherModule::Object < AR::Base
belongs_to :object, :class_name => 'App::Module::Object'
end
Using Rails 3.0.0 and Ruby 1.9.2, I get following error after accessing App::Module::Object.first.objects
:
NameError: uninitialized constant App::Module::Object::OtherModule::Object
For clearness:
Rails generate the wrong class name, App::Module::Object::OtherModule::Object
instead of App::OtherModule::Object
. It appends the :class_name
attribute to the current namespace, instead of replacing it.
Unfortunately same code is working in Rails 2.0, hope anyone out there can help me?
Greetz Mario