In Rails 3.0 (both RC and edge), any constant that’s defined while loading a file in development mode will get unloaded on each request, regardless of whether it comes from an autoload path in the application or from external code such as a gem.
Example file (tested on a fresh edge app):
require ‘nibbler/json’ # “nibbler” is a gem specified in Gemfile
This file can be either in “app/models/” or in “lib/”. Regardless of whether it was autoloaded or required, Rails will unload both Kittens and NibblerJSON modules regardless of the fact the latter comes from an external source (the “nibbler” gem). Additionally, if “kittens.rb” was required from “lib/” directory, Rails will never reload it, which might be a bug by itself.
There’s been a confusing amount of changes and reverts to autoloading/eager loading nature of the “lib” directory in Rails 3.0. I don’t know where we stand anymore, so I’m asking here in hope to get some insight.