On Sun, Apr 8, 2012 at 9:29 PM, Jim Gay <j...@saturnflyer.com> wrote: > Rails models/controllers are lazily loaded, so const_defined? might be > false even though you have a file that defines that constant.
Bingo. Ruby's autoload has a way to ask if a constant can be autoloaded, and I assume Rails' method does as well; ;but I wasn't sure how reliable they are. I figured by actually letting Ruby try to access the constant I'd be giving any autoload mechanisms the maximum opportunity to work before falling back on a stub.