Hi,
I seek to reopen model classes in several places in my Rails 3 app. In
order to do this, then, I shall need to bypass the autoloader. Here is
the snippet I have used in this attempt, placed in application.rb:
Dir["#{RAILS_ROOT}/app/models/logical/*.rb"].each { |file|
require_dependency "logical/#{file[file.rindex(''/'') +
1...-3]}"
}
(The ''1...-3'' above helps turn, say,
''app/models/logical/foo.rb'' into
''foo''.)
This is not working. My question is 1) where the snippet above might
be better placed to effect the intended outcome or 2) can someone
please paste any snippets they have used to explicitly load classes in
Rails 3?
Thanks,
Lille
--
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.