WikiGardening required. This is just a stub that needs to be expanded.
require_dependency”?require_dependency is used to reload source files on each request when in development mode. This is a great feature—changes you make to your code will take effect on the next request. (restarting the webserver isn’t required.)
I have a library/class file that is not being reloaded every time in development mode.
Make sure that you use require_dependency 'file/path' to require your file.
I require a file in conf/environment.rb with require_dependency. The file is not reloaded on every request.
conf/environment.rb is only parsed and interpreted once. require_dependency works exactly like require here. Place your code in a file “automatically” required by Rail’s “magic” like app/controllers/application_controller.rb.
How can I change the behaviour of require_dependency in development/production/test mode etc.?
Change [mode] in the line with Dependencies.mechanism = [mode] to :require to turn off and to :load to turn on reloading on each request.
*Apparently you use require_dependency should you use classes that inherit from one another, and it works right in test but not in development mode.