I have a class that I put inside lib/network
:
module NetworkApi
class NetworkProxy
end
end
Then in another class, I refere
Note that Rails 5 disables autoloading after booting the app in production.
From the linked blog post:
In the rare situation where our application still needs autoloading in the production environment, we can enable it by setting up
enable_dependency_loading
totrue
as follows:# config/application.rb config.enable_dependency_loading = true config.autoload_paths << Rails.root.join('lib')`