What does unloadable
do?
I saw this in the pages controller of High Voltage by thoughtbot. thoughtbot blogs about unloadable
, but am still unclear on what it does.
It means that when you're running on an environment configured with cache_classes = false (like the development environment) these classes are going to be reloaded by Rails on every request, so you can place them inside your lib folder or inside a plugin and they will always be reloaded without you having to restart the app (as classes inside lib or plugins are not reloaded by rails on every request by default).
This is mostly useful when you're building a plugin and you would like to do live changes on it without having to go through the process of always restarting your app on every test.
You can see the unloadable method documentation here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With