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
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---