Register now and start sharing your code snippets.
-->
How to make Rails plugins reloadable
Ruby posted 2 months ago by christian
I found this snippet on the Railshacks blog:
1 # Array of plugins that you want to be reloaded on each request 2 reloadable_plugins = ["has_markup"] 3 4 # Remove the plugins from the load_once_paths variable 5 reloadable_plugins.each do |plugin_name| 6 reloadable_path = RAILS_ROOT + "/vendor/plugins/#{plugin_name}/lib" 7 Dependencies.load_once_paths.delete(reloadable_path) 8 end