After discovering
http://api.rubyonrails.org/classes/ActiveSupport/Autoload.html
I thought
it''d be nice if we could replace our zillion occurences of:
autoload :Something, ''some_path/something''
with:
autoload_at ''some_path'' do
autoload :Something
end
But I keep getting undefined method autoload_at. I tried digging -
ActionSupport::Autoload is being loaded by the time it reaches the above
line (I tested by putting a puts ''loaded'' in
activesupport/lib/active_support/dependencies/autoload.rb and it worked,
and also require ''active_support/dependencies/autoload''
returned false.
I can only guess that while that file is being loaded, the methods it
defined aren''t replacing Kernel''s default autoloading support.
I could
try using "extend ActiveSupport::Autoload", but I don''t want
to do this
in every single file that uses autoloading (as mentioned above, our
project has a bunch of such files)
I also wasn''t able to find any online guides on docs on how to use
autoload_at, except the above API link.
Could someone help me with this please? Or is the activesupport''s
autoload library not intended for public use to begin with?
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.