On May 31, 2007, at 2:40 PM, bartocc wrote:
If I am right, when starting script/console (or script/server), models
are not automatically required.
But with you type MyModel.find(:first) in the console, it works. Is
there any kind of method_missing implemented somewhere that does the
require when console is feeded MyModel ?
That’s it, the callback is called const_missing.
That’s not something specific to the console, it is a Rails feature.
Note that a typical Rails application does not need to require their
controllers, models, helpers, …, but you should in regular Ruby.
That’s the reason.