开发者

How to force reload all vendor/plugins in rails 2.3 (development mode)

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 secon开发者_运维百科d 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜