Problem with reloading modules

See this Parked at Loopia

  • Using edge rails (Rev: 5322)

Hi, I’ve come across a problem I’m not quite sure how to solve.

I have a setup similar to that shown in the pastie. I.e. I define a
constant (which lies in a module) in a plugin of mine. Then in another
plugin I add a method to the ApplicationHelper which uses that constant.

If I set config.cache_classes to true for development, everything works
fine. But set to false, I get undefined constant errors (after second
request) for MY_CONST.

My problem appears to be that MY_CONST is not reloaded after
dependencies are cleared.

I’ve tried replacing all ‘require’ statements in both my plugins with
require_dependency but that doesn’t seem to help. In fact, for some
reason that doesn’t add my helper method to ApplicationHelper.

Does anyone have any ideas about how I can get this to reload in
development mode?

I’d appreciate any help with this as I’ve spent the last two days trying
to debug this to no avail.

Many thanks,

Saimon

I’d really appreciate another brain looking into this as I’m completely
stumped on this one.

Thanks

Saimon

Saimon M. wrote:

See this Parked at Loopia

  • Using edge rails (Rev: 5322)

Hi, I’ve come across a problem I’m not quite sure how to solve.

I have a setup similar to that shown in the pastie. I.e. I define a
constant (which lies in a module) in a plugin of mine. Then in another
plugin I add a method to the ApplicationHelper which uses that constant.

If I set config.cache_classes to true for development, everything works
fine. But set to false, I get undefined constant errors (after second
request) for MY_CONST.

My problem appears to be that MY_CONST is not reloaded after
dependencies are cleared.

I’ve tried replacing all ‘require’ statements in both my plugins with
require_dependency but that doesn’t seem to help. In fact, for some
reason that doesn’t add my helper method to ApplicationHelper.

Does anyone have any ideas about how I can get this to reload in
development mode?

I’d appreciate any help with this as I’ve spent the last two days trying
to debug this to no avail.

Many thanks,

Saimon