Hi people
I’m a complete new to rails, so sorry in advance for the stupid
questions
that I invariable will ask. I’m hoping that this one isn’t one of such
questions
While looking through my logs, i’ve found the following statement a few
times:
DEPRECATION WARNING: model is deprecated and will be removed from Rails
2.0
See http://www.rubyonrails.org/deprecation for details.
However, i’m finding that I need to explicitly call model for each of my
models which are contained in the engine i’m building. At the moment
they’re
being mixed into the ApplicationController so that everything can use
the
models. Am I doing something wrong, or is this a known problem?
So if you don’t include the ‘model’ directive then your controllers
can’t load your models? Is that right?
Can you load them automatically from the console? (i.e. without a
‘require’ statement)
This problem actually turned out to be related to the problem in my
other
e-mail with the controllers not loading. Before I changed engines.rb to
modify Dependencies.load_paths as well, they would not load
automatically in
the console (and i’m presuming in a controller as well), but after the
fix
they would load automatically. Before the fix tho, they would still load
if
you specifically said model :user, or etc.
My 2 cents is that $LOAD_PATH is only being used if you specifically ask
it
to load something, while Dependencies.load_paths is being used for
automatic
loading. However, the first time I knew what any of those two variables
did
was about an hour ago (and I still don’t really understand it), so take
that
for a grain of salt.
OK - let’s drop this thread and focus on the other one. I’ll reply in
more detail there.