views:

135

answers:

1

We have an application with a app/model that references another model stored in a plugin.

When the app/model level is reloaded on the second and further requests and that relies on our model in vendor/plugins/... (which stays loaded) it fails (can't dup nil class).

We've tried setting config.reload_plugins = true in the development.rb but this doesn't seem to do it.

Does anybody know a way to handle this?

A: 

It's an ugly problem. My solution has been to keep the actual model lightweight and in the expected app/models directory. Extract the code you want to share amongst applications and roll it into a module that you keep in your plugin. Include the module in your models.

Chris