Hello all,
I have a module, illustrated below, with a few classes. I have required
environment.rb and can access my models just fine outside the module,
and even within the module’s root, but once I try and access one inside
a module class I get an uninitialized constant error. Anyone know how I
can access these models within these module classes?
Module Illustration
module Foo
puts Chapter.find(x).attr ## Works
Class Bar < SuperClass
puts Chapter.find(x).attr ## Fails, uninitialized constant
Foo::Bar::Chapter
puts ActiveRecord::Chapter.find(x).attr ## Fails, uninitialized
constant ActiveRecord::Chapter
end
end