Making plugins reloadable

So is there a complete example anywhere of the best way to make
plugins reloadable? Specifically we have a number of models in our
plugins that need to be reloaded on each request in development. I do
not want to use generators.

I’ve seen references to using config.to_prepare like this:

config.to_prepare { require_dependency ‘foo’ }

What I don’t know is how to use this when we have 10 different
plugins, each with 3-4 models. Do I have to hardcode all those models
in custom code that I load in /lib, or is there a way to access config
from a plugin’s init.rb?

Chris

On May 27, 8:10 pm, snacktime [email protected] wrote:

So is there a complete example anywhere of the best way to make
plugins reloadable? Specifically we have a number of models in our
plugins that need to be reloaded on each request in development. I do
not want to use generators.

I just remove the plugin’s lib folder from
Dependencies.load_once_paths (in the plugin’s init.rb)

Fred